From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 498E6C388F9 for ; Mon, 16 Nov 2020 22:20:19 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D55892224B for ; Mon, 16 Nov 2020 22:20:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FxgQIrxk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D55892224B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BbZfA8NwAPuDlrLinkS/xoVYo5eI0mUK5wIYIR/of2Q=; b=FxgQIrxk1tZBYHUS+S+0wqP6i xMOMOTzfsnsh8L0rI35z6hKWLXoUrzGbBgW7OcuIwCUK6KSdWch+HPNkum2dGP1DEyo8CQqzsvQgp thyh/erHcfFlB9gl7D+t1Vc8tbzr8KR2NgxVo6d4HYjqcHT5Eaeg9i1tPCXTuMDgVjkcLFbXNZ1x+ as51p0f+hy42rCdhvJndcig39htDUnLT1ORugLGEwSzHzTzCoKRg6I6NO9nCcQisyptPc3fHdWr8I sI9IdBZ2eaXHHmA/V7bczHxNT5Q+rq9Z9RJTLDeyxHfr3Bq/VivbyyBvK7AQ+iPl7aIFEB/J8+ito XCrDvnhog==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kemqi-0007xt-LF; Mon, 16 Nov 2020 22:19:48 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kemqf-0007x8-Rs for linux-arm-kernel@lists.infradead.org; Mon, 16 Nov 2020 22:19:46 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: gtucker) with ESMTPSA id 213051F45D86 Subject: Re: [PATCH] ARM: head.S: explicitly map DT even if it lives in the first physical section To: Ard Biesheuvel , linux-arm-kernel@lists.infradead.org References: <20201116145650.25513-1-ardb@kernel.org> From: Guillaume Tucker Message-ID: <17b95b7c-8b76-29ab-9522-48dd6c3b005f@collabora.com> Date: Mon, 16 Nov 2020 22:19:41 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201116145650.25513-1-ardb@kernel.org> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201116_171946_002590_AC521CC6 X-CRM114-Status: GOOD ( 25.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linus.walleij@linaro.org, linux@armlinux.org.uk, kernelci-results@groups.io, nico@fluxnic.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 16/11/2020 14:56, Ard Biesheuvel wrote: > 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 149a3ffe62b9dbc3 ("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. > > Fixes: 149a3ffe62b9dbc3 ("9012/1: move device tree mapping out of linear region") > Reported-by: Guillaume Tucker This was initially found by a kernelci.org automated bisection, so please also include this trailer if it's OK with you: Reported-by: "kernelci.org bot" As explained on the other thread, this fixes the early kernel boot issue but then it fails to load the ramdisk. I'll try to see if there's any issue on the bootloader side. Thanks, Guillaume > Signed-off-by: Ard Biesheuvel > --- > arch/arm/kernel/head.S | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S > index 28687fd1240a..7f62c5eccdf3 100644 > --- a/arch/arm/kernel/head.S > +++ b/arch/arm/kernel/head.S > @@ -265,10 +265,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] > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel