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 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 B2983C433EF for ; Tue, 21 Dec 2021 16:55:32 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=53XIpj0u++M750jT5L2wzN8zIWDc6D/Nm2/Y1+G8Rvs=; b=q+sr6XqqA+GNCg Mm0bOXlTg6+2d4xTMIFr3cnMknYdb1XUXtnRI2NxTZUhjH15U4jAJjVNj+HIWGUNhyeBWmkAi8AYZ rvuBgB3z0MiQMgG8Cou5dUbuq0LP7z4TjGuk334rDzyDIusDOpLpNbVDGrIaXYkD4usjrigmHZfkD Cq++laKSAIz6/l3FHVyU/uuPcatFlhD1hkOIbH2nAtzOOTCtPhbT/bO4dUuVvdtLWaA+KdfjWe87Q Si0RH2T5z8lJWsG35UrvJKbBzpasV7qdMcDaP1D8IdsX3ZKtk/WyIc8pSmn5T3mBt5hc1McZ1XBLt 3FbeyPstd9cEeekYYE/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mziNk-007dez-AG; Tue, 21 Dec 2021 16:52:56 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mziNg-007dcO-Lz for linux-arm-kernel@lists.infradead.org; Tue, 21 Dec 2021 16:52:54 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 039B5D6E; Tue, 21 Dec 2021 08:52:52 -0800 (PST) Received: from [10.57.34.58] (unknown [10.57.34.58]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 99EED3F718; Tue, 21 Dec 2021 08:52:50 -0800 (PST) Message-ID: <1613df28-f7c6-9493-ec5f-db91415f3217@arm.com> Date: Tue, 21 Dec 2021 16:52:46 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH V3] arm64: Unhash early pointer print plus improve comment Content-Language: en-GB To: "Guilherme G. Piccoli" , linux-arm-kernel@lists.infradead.org Cc: catalin.marinas@arm.com, will@kernel.org, broonie@kernel.org, u.kleine-koenig@pengutronix.de, kernel@gpiccoli.net References: <20211221155230.1532850-1-gpiccoli@igalia.com> From: Robin Murphy In-Reply-To: <20211221155230.1532850-1-gpiccoli@igalia.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211221_085252_804146_034C07C0 X-CRM114-Status: GOOD ( 25.21 ) 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: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2021-12-21 15:52, Guilherme G. Piccoli wrote: > 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 for the virtual address shows a hashed > address there unless the user provides "no_hash_pointers" parameter in > the command-line. The situation in which this message shows-up is a bit > more serious though: the boot process is broken, nothing can be done > (even an oops is too much for this early stage) so we have this message > as a last resort in order to help debug bootloader issues, for example. > Hence, we hereby change that to "%px" in order to make debugging easy, > there's not much information leak risk in such early boot failure. > > Also, we tried to improve a bit the 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 is that is too early to do so; thanks to > Mark Brown for pointing that on IRC and thanks Robin Murphy for the good > pointer hash discussion in the mailing-list. Reviewed-by: Robin Murphy > Cc: Mark Brown > Cc: Robin Murphy > Signed-off-by: Guilherme G. Piccoli > --- > > V3: > * Improved commit message (thanks Robin!); > * Fixed comment style. > > arch/arm64/kernel/setup.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c > index be5f85b0a24d..a80430550a73 100644 > --- a/arch/arm64/kernel/setup.c > +++ b/arch/arm64/kernel/setup.c > @@ -189,11 +189,16 @@ 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 %pa (virtual address 0x%px)\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(); > } _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel