Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp464376iog; Fri, 17 Jun 2022 07:00:06 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vVxoFbtyQRh8/7xPU7vUR7MPHQhS4I3vZfe5Mq3MS1SsWuYeJnzGm17yKc9mD2dSsLz7Rz X-Received: by 2002:a17:903:2452:b0:166:4b6c:aff2 with SMTP id l18-20020a170903245200b001664b6caff2mr9731396pls.105.1655474406196; Fri, 17 Jun 2022 07:00:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655474406; cv=none; d=google.com; s=arc-20160816; b=gIyt1i3D9F0YE8RzXFdltUil0YS5N+AcA7HKaFKk9OjURC2y1WiyupCBn0g7WpUJXJ uQcKn4rFOSC+R3gpArHT9rwqQLpN6ceHQQ0mn0nxzPKzlCaScjS69DgBGJrC6vycglg+ l0qVqm0Hyt3cxTLGgH6fJXu2M4G1XTzVqZFzA0Jq/PDhf0SwLy5o9pAJVAPmXstkDJh9 k4kNOQvGiEXhozhpyHTtQ7uWd1iTwozy7QJKLbWTDtOFbgdKepJNk3TT3Ku4Jho3asn+ ga4nVEnfW8yH2zME9vWwQaV7ZwJ2k4JsYHsWFQMOBXFvPX9DMwp+ZaY5yL9+KP5dr3Xu 6Jug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id; bh=86STnsyIDT8tyilfD7kcvi4SGXdWk+TBhbi3qDbVRjg=; b=m09/NiVYRZZmBhmEoqTVq5WdoMMcZijtFtr9H0EgQtE0GIHLWYsUxncs5TIdWZk3Sg d1K2yOzJSVSyhWY0Itw/KePlxEZIQRYyCRJ1ZxmB/x1kiqUbPXLU+N4LJYxIz2yYJ80a hm2rlp1AZX+0PcK4Aap11DhKNaMII5Kp3L4XLtE6krG3dKRhZYoJo/lMp6+eQfbiXozY x6xEHh5wAjHtvu5hrpjbiPNlp3fWrWkiqEkzDNvxOzBm6vusnlu2dZODVZmqLGXYmDgj wJOctaWRMdCyfHrZNoHkn0G3rrdHxxeJKXl3bx1DHtUVQhnJMTnG4gZ0+E0ht0ZvZnmB R4sA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kb3-20020a17090ae7c300b001e33517868dsi11160259pjb.150.2022.06.17.06.59.50; Fri, 17 Jun 2022 07:00:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381599AbiFQNb6 (ORCPT + 99 others); Fri, 17 Jun 2022 09:31:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236792AbiFQNby (ORCPT ); Fri, 17 Jun 2022 09:31:54 -0400 Received: from out28-77.mail.aliyun.com (out28-77.mail.aliyun.com [115.124.28.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C5CBCF5 for ; Fri, 17 Jun 2022 06:31:45 -0700 (PDT) X-Alimail-AntiSpam: AC=CONTINUE;BC=0.09729436|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_regular_dialog|0.0811532-0.0012695-0.917577;FP=0|0|0|0|0|-1|-1|-1;HT=ay29a033018047192;MF=victor@allwinnertech.com;NM=1;PH=DS;RN=10;RT=10;SR=0;TI=SMTPD_---.O76jcEA_1655472657; Received: from 192.168.220.136(mailfrom:victor@allwinnertech.com fp:SMTPD_---.O76jcEA_1655472657) by smtp.aliyun-inc.com; Fri, 17 Jun 2022 21:31:31 +0800 Message-ID: Date: Fri, 17 Jun 2022 21:30:57 +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 From: Victor Hassan To: Linus Walleij Cc: linux@armlinux.org.uk, rmk+kernel@armlinux.org.uk, yanfei.xu@windriver.com, ardb@kernel.org, tglx@linutronix.de, mirq-linux@rere.qmqm.pl, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20220316023356.120595-1-victor@allwinnertech.com> <0fa192d1-b6cc-4a8a-c319-36471cba79e8@allwinnertech.com> In-Reply-To: <0fa192d1-b6cc-4a8a-c319-36471cba79e8@allwinnertech.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/18/2022 11:08 PM, Victor Hassan wrote: > On 18/04/2022 07:21, Linus Walleij wrote: >> On Wed, Mar 16, 2022 at 3:33 AM 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 >> >> I think noone really noticed this because everyone on Arm systems >> use CONFIG_DEBUG_LL, and that makes printascii hammer out >> stuff on the console very early, it even accounts for whether we have >> MMU on or not. >> > Hi Linus, > Thank you for the reply. I used earlycon, in early_fixmap_shutdown, the > base address of earlycon is in the critical stage of release and > reassignment, so early_fixmap_shutdown -> create_mapping should not call > earlycon in this process, and create_mapping has a lot of conditions > that trigger print, memblock=debug just makes it easier to expose problems. > >> How are you using this on Arm even? What system and what serial >> driver? > I'm using serial driver 8250 on arm32, with cmdline: memblock=debug. > CONFIG_SERIAL_8250=y > CONFIG_SERIAL_8520_CONSOLE=y >> >> That said, it looks correct. >> Acked-by: Linus Walleij Hi Linus, Sorry to disturb. Is there any question about this issue? Thank you :)