From patchwork Mon Dec 20 15:54:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Guilherme G. Piccoli" X-Patchwork-Id: 12696861 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E96E0C433F5 for ; Mon, 20 Dec 2021 15:56:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=W2NQ+UY207RR3uQ9orF1xYqAFCoWu+AK77sqnDWSVxQ=; b=MH7lkAjswxRzgc SD8XODPZts7nFy1QqtaeH+qwlo0Kli6Laq18TO8xUIWPkakTlO3zmz2g4JzX+VhV70QcIS1qPfz6j hTDedLWDv4FVdAOk2yjsGTmuZNCghivthVLTd31aTqKQwuGfcuv7K0V0x2OBVc2MkIT1zAMeDIQ/C u5U7z9c8y8TZSm2MnVNUnobF8fXIVTIJtI3J8pcSpyXQutNYOSExKw8LkeTSVchdZJg5Tyr+2I7zi Kl4WOTTYV377cdDtC6yepR1AIhBCy7e9IlNpTF/XuvElf33462ohy8nVFLFItx91R9HQgi4hgwhN/ kBtz/3Sriwb9IamGrGyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzL0c-003BWj-Mt; Mon, 20 Dec 2021 15:55:30 +0000 Received: from fanzine2.igalia.com ([213.97.179.56]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzL0K-003BMR-SJ for linux-arm-kernel@lists.infradead.org; Mon, 20 Dec 2021 15:55:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=QMbUT39ktgiEhj5HJN8s5KczRNyThLM+wRLtQicilH4=; b=iI/RK99SYdjjEEb9OUeSpji5O/ U+Zk/6edDMFjci+qwhhFfcHA96aNm5H/7ZzK4b6GT5w2AIwZ/WKo/rlmNCucZ41tIr2omfyDw8y+J bJk7Afu/npZSKl8mhpPbecDVwAKKqFpyMNs7Z/KSqDDzmpVhMhLY10prPhYP+5fJUwQZp+chI32ra Z+LiNYydbALuKZq0cHRuqVTamQYxYwsRevuv+MBWiH5d5FwMW91PNE+K4452r+JCmRdjowi47Pqqp IgaG0XbKAptDCAr4bJUtJ5VrbX0PC1sGRrBJGCAztmKujh21wQlQ6FfA8XeS9SNY7wIst6PgB0/SK MOzPT9Bg==; Received: from [177.103.99.151] (helo=localhost) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1mzKzs-0007zr-O5; Mon, 20 Dec 2021 16:54:45 +0100 From: "Guilherme G. Piccoli" To: linux-arm-kernel@lists.infradead.org Cc: catalin.marinas@arm.com, will@kernel.org, broonie@kernel.org, u.kleine-koenig@pengutronix.de, gpiccoli@igalia.com, kernel@gpiccoli.net Subject: [PATCH] arm64: Fix early pointer print plus improve comment Date: Mon, 20 Dec 2021 12:54:27 -0300 Message-Id: <20211220155427.1499417-1-gpiccoli@igalia.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211220_075513_089650_513F53C5 X-CRM114-Status: GOOD ( 13.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When facing a really early issue on DT parsing we have currently a message that shows both the physical and virtual address of the FDT. The printk pointer modifier there was not right for the physical address, due to the hashed address stuff, so hereby we fix that. Also, we tried to improve a bit commenting on that function, given that if kernel fails there, it just hangs forever in a cpu_relax() loop. The reason we cannot BUG/panic there is that is too early to do so; thanks to Mark Brown for pointing that on IRC. Signed-off-by: Guilherme G. Piccoli --- arch/arm64/kernel/setup.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index be5f85b0a24d..0d5c51a9549e 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -189,11 +189,15 @@ static void __init setup_machine_fdt(phys_addr_t dt_phys) if (!dt_virt || !early_init_dt_scan(dt_virt)) { pr_crit("\n" - "Error: invalid device tree blob at physical address %pa (virtual address 0x%p)\n" + "Error: invalid device tree blob at physical address %px (virtual address 0x%p)\n" "The dtb must be 8-byte aligned and must not exceed 2 MB in size\n" "\nPlease check your bootloader.", &dt_phys, dt_virt); + /* Note that in this _really_ early stage we cannot even BUG() + * or oops, so the least terrible thing to do is cpu_relax(), + * or else we could end-up printing non-initialized data, etc. + */ while (true) cpu_relax(); }