Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3749266iog; Tue, 28 Jun 2022 01:49:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vGfuvmUe5RJYMCfFKRZw+P7+FDjr45D5CyRu1AapA5KZ49rXBndH9vleQbAs2RfjDfuBPm X-Received: by 2002:a17:902:b08e:b0:16a:85d:6cf5 with SMTP id p14-20020a170902b08e00b0016a085d6cf5mr2644890plr.36.1656406151538; Tue, 28 Jun 2022 01:49:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656406151; cv=none; d=google.com; s=arc-20160816; b=cFEmmyt8EIgkXesH8IS2bvP9u5A7XHDWs5nCexd1Qgo6ZfAZFZ7PLET6LItiSCJit5 YNedizrBjoqGgCii1gzbEZ1Cq+6tX13ZaP69rHI+kO55SiH5TG1WeWiT9pdMBUfZiQys co0Pm6IqS4oLxbAdLGiak2XYk/fYTZ3su3ch5S4biZ05klSwk43OoYRjewe1kAWbguaZ +ccGNyLLZXITYnO8Ao/XJkBnafVJFu3Aqi139C9UpabD0AYmmJLeWBF6evCq2X0n20e9 mgdG9Gn+BYHk6oStky0QaSTtnHvNo1cDYmp5yQZsGp+rkgEnyvTuhX+jkcJrnpio6VRC mxyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=synmmJZnLm8aL3NMaA4e9ZWQLnsLjsBBEEt8zQsVKJQ=; b=yDv42JFZB0w3gocuW8ykZZ7r22RXLfHFwTQ9pedJjEdf3dp0IQgm3Tf+CZTlG9YvBy ouWJJ8gqCETJstTjF5uKHba4VdjkahxHBZ1y1WzKpefDVzEXTUaIkAdDfFxj6HgaTAQp VaaBZt5uCw8xSVodLxEMmZRWLJgZG/ARms/xQbRNOfqRFQ9T3I241hyR8XGxus6chyuj ipqqW9GdxQNdkUlm+PxpI/HxbpYCTZPu4tkHysGQWPl34VNCg3vkgtOP8YbjfSsk+4Ix jiL1tg4hEvqqYbOEsF4eljuRzXcs7eTujf0Ni+VrkRXqJlERarV1518/8EPuoMy8AV44 eIAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G4z4zRLq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h8-20020a056a00170800b0052551b26480si11681700pfc.99.2022.06.28.01.48.59; Tue, 28 Jun 2022 01:49:11 -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; dkim=pass header.i=@linaro.org header.s=google header.b=G4z4zRLq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343952AbiF1IfH (ORCPT + 99 others); Tue, 28 Jun 2022 04:35:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244749AbiF1IfF (ORCPT ); Tue, 28 Jun 2022 04:35:05 -0400 Received: from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com [IPv6:2607:f8b0:4864:20::112e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59BF12872B for ; Tue, 28 Jun 2022 01:35:03 -0700 (PDT) Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-317741c86fdso109204787b3.2 for ; Tue, 28 Jun 2022 01:35:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=synmmJZnLm8aL3NMaA4e9ZWQLnsLjsBBEEt8zQsVKJQ=; b=G4z4zRLq1xsw40QPegly4S6z82j4rzBgTc8W3E1wt9VI1WdYEJnh+Cvhz93jh6eJrs 8fTddQPYL9Cpd/9RueHGKQybtak14IsU+2+YRJfubFD7VvI0pTuKGRKomNPzpplzUm+s LnQLJuWXKAUZz9AzbpaW1BDXfeFa3FPEhLNRwXpsUOwMCcsGn+81bI7szulf6L8k4JHb lhZluPGrQpWpHibVdSqf//xFrPSXegHaY7M0ekWTf1/NDYDwSj0Zs89OG4QL5AMnZCiV ypvLkQHXtQT8YxiXEQFrWSbJnd6YJIHrlOSJJHlG/2DWd2PaAXkYZPE2/rSE2HIjIHYf hTQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=synmmJZnLm8aL3NMaA4e9ZWQLnsLjsBBEEt8zQsVKJQ=; b=seJP398oYrXlcwETHWxO6LS7nzUYf6dD4NZnkDNZEXu2OBMxNqRJ9/q2hQ82l3Hna6 A/qf4r9w9QppWGncExsGmXaPOUtOkgP96laCB2IuFG1f222wBrBDiTASzNbuW5D8DFF1 3KCYj78PXYxjSPU8AaOOedk7e/voEkvmbWbvh+up3m/CKBIgT4rB1A9hnERD8w7zZ+2T 4mJnMqzHPuM2xthdlKXClRjAch4na9lJbb0yZHTMbftlqefRFhMNLQKV8tGNq2k6Fjv4 GBB+kZrrwooiaoKWmlXBpLUIfWH0dzbjnm4ZSc9DcjzQkVGFh60Q9cyuSw4we70ee/LI i0wA== X-Gm-Message-State: AJIora+VgoLMuU+4kz2cAi5VAYlYdG9SiBFfqQOaW8wiP0G/sJPTllZq Yu0EnvVuEJv6AuOkK3tjxx2L9Ie9fbCrPaI+Y41IAt5vIyBg9A== X-Received: by 2002:a0d:e20a:0:b0:317:ce36:a3a0 with SMTP id l10-20020a0de20a000000b00317ce36a3a0mr20657589ywe.448.1656405302575; Tue, 28 Jun 2022 01:35:02 -0700 (PDT) MIME-Version: 1.0 References: <20220316023356.120595-1-victor@allwinnertech.com> <0fa192d1-b6cc-4a8a-c319-36471cba79e8@allwinnertech.com> In-Reply-To: From: Linus Walleij Date: Tue, 28 Jun 2022 10:34:49 +0200 Message-ID: Subject: Re: [PATCH] ARM: mmu: fix access to illegal address when using earlycon & memblock=debug To: Victor Hassan 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Fri, Jun 17, 2022 at 3:31 PM Victor Hassan wrote: > 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 :) No, I understand the problem, I provided my ACK. Maybe you wanna add the patch to Russell's patch tracker so he can apply it? https://www.arm.linux.org.uk/developer/patches/ Yours, Linus Walleij