Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp659533pxj; Tue, 18 May 2021 11:13:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHTovMfnzlerNxIBGrWh5jZ7FV8LYs61rfKSqd9MXE8R0Gc1byck0WzCQTAis35E82ZJCY X-Received: by 2002:a17:906:349b:: with SMTP id g27mr7237248ejb.218.1621361580813; Tue, 18 May 2021 11:13:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621361580; cv=none; d=google.com; s=arc-20160816; b=GRscWeAPHXbLg87PAEpCFXjQBzmIojnTEEE1HCaPlEP4HL5L99Z5x8bf6dsTgxT22D 0TewXIRDEG26Cr89r3n7psrFUhNC7O7sl9W34O2sMePHQQm/cjQ7CdV17n43S7Jnqz7X 8uWsyw/pw+Qd5dxt2SYWd/XkmXdOS4cjk+PhsOajtt6xyef6ho5KsETam2YrVFsp7Lop 9+XgV+nuKGWrMMaBpLoGHSZLGLeJEcVvJPUawuL7UlT0FBw5XMQjbPuT4+ZBoNw0I659 jqUOXowVPi+KoN+2Im4UuKbggiloGI6QtWUOFdlnir7Re4JwMCbiAB+N9zHC8f9td/NV +iTQ== 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=wfqkaO+2f5wWyLkeHlzJsUkImcVMFPJ6BXMJr2YWzZ/v/oezQkCNtp/xDyg+ZDwK+O tifCnJQep6z8DlCD+n0/5puuraHPzFfU0mFRDDBI1jR8MOlGBmHqRrNraakaIP8Vqjir tL1nNqGQx6wLugxS1tN0+rbA0Y5TAMZTHA6tz0y6+1Jy7+lCBLLIlhHdJvsAgQCI4bEJ 4RsIP52Q1By7efBGeVjzVdnQOhLNxcGFBrcFYV6odJ5tIP06PyVjoMv63TWv6dsn6/zt pchFc/Pax5gDinFRopXgMDESGGO5HOM7LAABABKP6ag7EjJoMxMe7P9n1EuHopBhNkoT N9Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="1G8bd/P6"; 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 f24si12276304edq.310.2021.05.18.11.12.37; Tue, 18 May 2021 11:13:00 -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="1G8bd/P6"; 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 S1344615AbhEQQMK (ORCPT + 99 others); Mon, 17 May 2021 12:12:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:36360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245377AbhEQPsZ (ORCPT ); Mon, 17 May 2021 11:48:25 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 031376195D; Mon, 17 May 2021 14:45:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621262710; bh=sR9RtU9rmIeaagdxWOfkIzp4CvBkwCckfDcFl20vvUA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1G8bd/P635cFCMzNgk7/wwcUBJtHwPuaUW/xIBId20ag+/on2Qj5LImu81kcfD1D6 oM8+tFOKJa/ch770mSR3v7RrXuVMIZX64Ux7euDsjBG+2BbrsxJ+WUgl971izPIX3j 0b9i1ZSM6N0g1+lZMBiSP4NWnYKnvpQk0mn9aVTk= 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.10 274/289] ARM: 9027/1: head.S: explicitly map DT even if it lives in the first physical section Date: Mon, 17 May 2021 16:03:19 +0200 Message-Id: <20210517140314.363696055@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@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]