Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp417591pxj; Tue, 18 May 2021 06:22:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZCdY3MV6ePsv67yFMN6KVUAvs29qu5lYkNUJOF5CxBVqF5mCUOwx12v9958EVQrfLV2D3 X-Received: by 2002:a05:6402:51c9:: with SMTP id r9mr7060234edd.94.1621344149022; Tue, 18 May 2021 06:22:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621344149; cv=none; d=google.com; s=arc-20160816; b=JQ2RYM9QRfHDlzrWZdiPk7Ls3Rq8o55up3xcoEswtsfz6xixZDedOKcanq2S34CocP O1ngksPwJMSRbdy8m89PtBlX5nh1YPKFoWqW5K/xwOd7nJ36GCjZgf7etjEr9I+GbPlF dtpQ2+ZwKwG1/vPWsb41wduEr+oVPrt9GmFKmLR9mumDrjn7+iTdMRbGfOFvnEmMjgEt VvAm77diTFWuruzZ7Wb+ULnT0A1moSgPUwfDHkzmhW5zZ76jzexqT9ebPlxQ6imKFIx7 q09m/+YG34EhyHus/6oFwi1IbGwDAD/skY8igT5wsOJpLA2Uu8Fcr/X1rV+S4IQCi7WN Zn3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NqkN2yjR7+pMZhsPkrD1jwt1qeB4Ju6ZNGSyL2Z9g2E=; b=kS3JrJjzXp1Jb+2zcoaYM6bbP0U04QrC2YwYLdB2s1z5dLRBqr9oOOJ0GzKSm/lPqu 5iQph5Jutv2uoxCg9zeIMHnC9nydkMsqIh/Z0DFrdhDhsM7QgXg9t6OiCFUgYYxjfaMh ZMf8N1AeBqzQk3Ts25KBHIOjPVCy9WYSO9SLPgZtIMIugegRE8BFUxFnj2/1ylu5UyyN zFcBC2IpFpyAqv8ELfK2YJEP3RW6cjDEYnJkFKFyx++wlBkb8kleuW9b/5zCyALJ3vYO SGoFRatA9/6tzndIkimbg82cENSen7Dgd9E4vPweBXzCAQUUpSRtz2yD5YqG7gG1z5UU q/RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=G5iHwcEN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id co1si14085664edb.166.2021.05.18.06.22.05; Tue, 18 May 2021 06:22:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=G5iHwcEN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244453AbhEQPhs (ORCPT + 99 others); Mon, 17 May 2021 11:37:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:40572 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244832AbhEQPWI (ORCPT ); Mon, 17 May 2021 11:22:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 28E7361C94; Mon, 17 May 2021 14:34:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621262089; bh=sR9RtU9rmIeaagdxWOfkIzp4CvBkwCckfDcFl20vvUA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G5iHwcENShI0VDWxrzCvze/jGDNHebcAUCN6DlAOm2KUOPFDRY+j3mXxMJOc9fQPV AEuB1ENr5O/1pvbyZvC28TtG2Nlc48Ke+xOBLVCSQUrf5FEgpkvzmNlatm9IFYpkgN 0R9nJ6suD7aL9Ea1z1Th6lFhsmvvi6TKMuPLXBZw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , "kernelci.org bot" , Linus Walleij , Ard Biesheuvel , Russell King , Florian Fainelli Subject: [PATCH 5.4 135/141] ARM: 9027/1: head.S: explicitly map DT even if it lives in the first physical section Date: Mon, 17 May 2021 16:03:07 +0200 Message-Id: <20210517140247.368131857@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140242.729269392@linuxfoundation.org> References: <20210517140242.729269392@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ard Biesheuvel commit 10fce53c0ef8f6e79115c3d9e0d7ea1338c3fa37 upstream The early ATAGS/DT mapping code uses SECTION_SHIFT to mask low order bits of R2, and decides that no ATAGS/DTB were provided if the resulting value is 0x0. This means that on systems where DRAM starts at 0x0 (such as Raspberry Pi), no explicit mapping of the DT will be created if R2 points into the first 1 MB section of memory. This was not a problem before, because the decompressed kernel is loaded at the base of DRAM and mapped using sections as well, and so as long as the DT is referenced via a virtual address that uses the same translation (the linear map, in this case), things work fine. However, commit 7a1be318f579 ("9012/1: move device tree mapping out of linear region") changes this, and now the DT is referenced via a virtual address that is disjoint from the linear mapping of DRAM, and so we need the early code to create the DT mapping unconditionally. So let's create the early DT mapping for any value of R2 != 0x0. Reported-by: "kernelci.org bot" Reviewed-by: Linus Walleij Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King Signed-off-by: Florian Fainelli Signed-off-by: Greg Kroah-Hartman --- arch/arm/kernel/head.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -274,10 +274,10 @@ __create_page_tables: * We map 2 sections in case the ATAGs/DTB crosses a section boundary. */ mov r0, r2, lsr #SECTION_SHIFT - movs r0, r0, lsl #SECTION_SHIFT + cmp r2, #0 ldrne r3, =FDT_FIXED_BASE >> (SECTION_SHIFT - PMD_ORDER) addne r3, r3, r4 - orrne r6, r7, r0 + orrne r6, r7, r0, lsl #SECTION_SHIFT strne r6, [r3], #1 << PMD_ORDER addne r6, r6, #1 << SECTION_SHIFT strne r6, [r3]