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 99409ECAAD1 for ; Wed, 31 Aug 2022 12:39:31 +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=kv+1UZyysk42hlmaW4KNpkkgjohlak8XeMUXSaNCKvg=; b=3Yx6AKWlHuwVr6 5OHovnwX8U+AMk6WoXSuG/OA03GlErttoPgqJqDH4C0uho7GZ/QFqoYmcudijV0407CbsLtGSK/4O A40AQ4h/1HnQGt48rk7DpFGvUNwcDCuzTu/x+Ymh8+2EmVgMOBM+asHkUFJcT8hrmklmTRlLJjyVc VWTbvNklbF50zE1tCB39HDrNixnw9tJaIlsX/0RhwzMIXcKAZhuHHPjmM8Lt4JMKCktQ/yBME4/8a PZuYmPzBKOH03gD+coT6zYg6EHtPPnwSgKzrhCDz+JafzqG7a5N2hh/QJHuA1dMj51oEwgUDJ62wH wlZpDscwN23R5nTFJx2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oTMzJ-0065iz-NW; Wed, 31 Aug 2022 12:38:33 +0000 Received: from out28-170.mail.aliyun.com ([115.124.28.170]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oTMz9-0065g2-4S for linux-arm-kernel@lists.infradead.org; Wed, 31 Aug 2022 12:38:25 +0000 X-Alimail-AntiSpam: AC=CONTINUE;BC=0.07722721|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_news_journal|0.0675243-0.00153387-0.930942;FP=0|0|0|0|0|-1|-1|-1;HT=ay29a033018047198;MF=victor@allwinnertech.com;NM=1;PH=DS;RN=11;RT=11;SR=0;TI=SMTPD_---.P4QJDlq_1661949456; Received: from 192.168.220.136(mailfrom:victor@allwinnertech.com fp:SMTPD_---.P4QJDlq_1661949456) by smtp.aliyun-inc.com; Wed, 31 Aug 2022 20:37:39 +0800 Message-ID: Date: Wed, 31 Aug 2022 20:37:36 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH] ARM: mmu: fix access to illegal address when using earlycon & memblock=debug Content-Language: en-US To: Marek Szyprowski , linux@armlinux.org.uk, rmk+kernel@armlinux.org.uk, linus.walleij@linaro.org, yanfei.xu@windriver.com, ardb@kernel.org, tglx@linutronix.de, mirq-linux@rere.qmqm.pl, arnd@arndb.de Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20220316023356.120595-1-victor@allwinnertech.com> <9a425a51-9460-6c4d-e331-5cd5873f8a43@samsung.com> From: Victor Hassan In-Reply-To: <9a425a51-9460-6c4d-e331-5cd5873f8a43@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220831_053823_407331_140E6BBD X-CRM114-Status: GOOD ( 15.44 ) 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 8/31/2022 7:52 PM, Marek Szyprowski wrote: > Hi Victor, > > On 16.03.2022 03:33, Victor Hassan wrote: >> earlycon uses fixmap to create a memory map, >> So we need to close earlycon before closing fixmap, >> otherwise printk will access illegal addresses. >> After creating a new memory map, we open earlycon again. >> >> Signed-off-by: Victor Hassan > > This patch landed in linux next-20220831 as commit a76886d117cb ("ARM: > 9223/1: mmu: fix access to illegal address when using earlycon & > memblock=debug"). Unfortunately it breaks booting of all my test boards > which *do not* use earlycon. It can be easily reproduced even with QEMU. > > With kernel compiled from multi_v7_defconfig the following setup boots: > > $ qemu-system-arm -nographic -kernel arch/arm/boot/zImage -append > "console=ttyAMA0 earlycon" -M virt -smp 2 -m 512 > > while this one doesn't: > > $ qemu-system-arm -nographic -kernel arch/arm/boot/zImage -append > "console=ttyAMA0" -M virt -smp 2 -m 512 > > >> --- >> arch/arm/mm/mmu.c | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c >> index 274e4f73fd33..f3511f07a7d0 100644 >> --- a/arch/arm/mm/mmu.c >> +++ b/arch/arm/mm/mmu.c >> @@ -14,6 +14,7 @@ >> #include >> #include >> #include >> +#include >> >> #include >> #include >> @@ -1695,6 +1696,9 @@ static void __init early_fixmap_shutdown(void) >> pmd_clear(fixmap_pmd(va)); >> local_flush_tlb_kernel_page(va); >> >> +#ifdef CONFIG_FIX_EARLYCON_MEM >> + console_stop(console_drivers); >> +#endif >> for (i = 0; i < __end_of_permanent_fixed_addresses; i++) { >> pte_t *pte; >> struct map_desc map; >> @@ -1713,6 +1717,9 @@ static void __init early_fixmap_shutdown(void) >> >> create_mapping(&map); >> } >> +#ifdef CONFIG_FIX_EARLYCON_MEM >> + console_start(console_drivers); >> +#endif >> } >> >> /* > > Best regards Dear Marek, Thank you for the notice. I'll figure it out and feed back to you as soon as possible. Regards, Victor _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel