Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3174334pxb; Mon, 18 Apr 2022 18:06:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzXeLn8Zb+GoYGLDMGQLCTi0QUimvy+WQTIpKvtq7Hwhkr8TImW8IaB0RiX+C0vyhukfni X-Received: by 2002:a17:906:16cc:b0:6ce:e607:ff02 with SMTP id t12-20020a17090616cc00b006cee607ff02mr10914741ejd.418.1650330391975; Mon, 18 Apr 2022 18:06:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650330391; cv=none; d=google.com; s=arc-20160816; b=yjU3yTdpudVkdAiE3jo53chkA669xBGVc4rYCjHmZOFk8YgCHicfO9TTQ+LkVKPGJr eS7Q2I+Vw2l6jSo0oYHEJfCwBPiXKHNZp6eTbvUKz+gFs4szC10zCG7QaDKKY618Unaf lhIuhThRhk3IPR+XfxXRpdmS3gMiTged7kiQwq6SkEFZUoZMaaCZyfKfzoQ1gYwneRVa IRbfy3XDoEa6yYv91bBG7uc6kjfIrd445z2KqLCs0NkGi1X/U9A0pssG87vZkoksd/N3 WwuajetoyiWxGsR5VzJtME8L7Q5uGr/fG+MRmkbbVfyGHAMSCrslrL242afY652oq8Cw YuKw== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=l+wCnL3GTr3P/wkNYcBINFL4pUUv2mVkrd+ThQCx2qs=; b=EgJHFd1JIwzGoPi5y63jjIVtuKQd7ERxP3TdBn+MOlHbRkjEoEcPFn8YsckqLVRjvu rxG5AGbA+d4SewysiGoFlfmTm0FTOAQt6WNIkhfl2kgD4nshqmvUJtcZHmq4rJ3MMOJq DkPiJQSoG7rRr7i3G9MNcrG1Oov99tZIlG64xnRtWWxHgrj71m9+Yzon388ZxHTupGSk Gn8xgADbrLwVG6eNTEUpM0sIaz/moqOyImZ5K62jEe6KK+ajBVH6ZH6RLwcrQ1qq9M+e o5LPoS6KvLIslP4/LZPL1tXVrIYlbwJndWyx8MH6J91U4zkiWN5CdvX0co7KX7ozwyDg rcwA== 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 o6-20020a509b06000000b00418c2b5be1esi8194455edi.256.2022.04.18.18.06.07; Mon, 18 Apr 2022 18:06:31 -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 S1345359AbiDRPnY (ORCPT + 99 others); Mon, 18 Apr 2022 11:43:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345669AbiDRPmx (ORCPT ); Mon, 18 Apr 2022 11:42:53 -0400 Received: from out28-125.mail.aliyun.com (out28-125.mail.aliyun.com [115.124.28.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 340D2344F0 for ; Mon, 18 Apr 2022 08:08:07 -0700 (PDT) X-Alimail-AntiSpam: AC=CONTINUE;BC=0.1217452|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_regular_dialog|0.0823759-0.00362085-0.914003;FP=0|0|0|0|0|-1|-1|-1;HT=ay29a033018047212;MF=victor@allwinnertech.com;NM=1;PH=DS;RN=11;RT=11;SR=0;TI=SMTPD_---.NT4Udz._1650294482; Received: from 192.168.10.102(mailfrom:victor@allwinnertech.com fp:SMTPD_---.NT4Udz._1650294482) by smtp.aliyun-inc.com(11.95.168.178); Mon, 18 Apr 2022 23:08:03 +0800 Message-ID: <0fa192d1-b6cc-4a8a-c319-36471cba79e8@allwinnertech.com> Date: Mon, 18 Apr 2022 23:08:09 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] ARM: mmu: fix access to illegal address when using earlycon & memblock=debug Content-Language: en-GB 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, allwinner-opensource-support@allwinnertech.com References: <20220316023356.120595-1-victor@allwinnertech.com> From: Victor Hassan In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,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 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 Thank you. > > Yours, > Linus Walleij Sincerely, Victor Hassan