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 294C7C43334 for ; Tue, 28 Jun 2022 08:36:23 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ltkkcQG6H8fhdkPGsWJLjjoTjr8CXB99LK+rmWO/dA8=; b=RxQwNJwTrKMq2J Sq9lWboL2YJVY0e6d0PkdOwM+j+4nu9jtT7zE4CYxAdgCT2RPUbTlM+Vad+yiSH+LCVl85+1JAV05 Q9dv1Qm7g7u0wjq1UBAZiySmiW74HalvKrZQ3tZylZD6rdY+zI3+rcdhHE+PE2oKwtO7H6J6J0EEs 3Xd9JG0FhIXQg4GFkyQZbKzJQE6qHR1RzTwZ0V6yt1KDey062SyONKS5k8Lg400hSNychwaitBnbU eexCOePPCw7aIUIv6Z3PiASt1ryUnK7WwR3i4Yjs8qbuR0o8nszsBdoq6hbyN4vLwQ05FdQerr3Ql WWJTirPD4blDiC0jV2IA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o66gi-005JHB-OM; Tue, 28 Jun 2022 08:35:13 +0000 Received: from mail-yw1-x1129.google.com ([2607:f8b0:4864:20::1129]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o66gd-005JDf-0t for linux-arm-kernel@lists.infradead.org; Tue, 28 Jun 2022 08:35:08 +0000 Received: by mail-yw1-x1129.google.com with SMTP id 00721157ae682-317a66d62dfso109072557b3.7 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=xi4paskjclDpE9ketB7qY6dJh7GeOP3K0wOFK3u1naMKZJrHhQCtgVPhob9wxLp0N7 9Ctwn3Pu+htBDEVfs3/numc7g26PMBKsDuzeon4YbSB+O7EtB9TcGDozohcRkb5wGwaI 1pFzyv4aMuB5fO9KgnysU57/odmO1ANhRNxIQQfXxHmD7z6I+q3VF1Ji6cWekKTPGjwh 4MYwSLY6dOkXcNHzXqyNkR32/9YjEnnsYGzYt1HDmDtJAw0fJO1X20Wkdp8aIgiQjUNY PVk96YnFHhhwALT3W4U9vI8KBFjqViHpsLk5gTu7kbG9YrUfCw3cWXnT/nseUOCit0hz BlOQ== X-Gm-Message-State: AJIora/F3T+VrVwOzXC7MSgB9QA5iYq7rI2yLzoFm97sKs48cPIeYmvG 7BWsqcYfowMrNuSj6ONMMVAczz1/G1v0wKzOSmZDpQ== X-Google-Smtp-Source: AGRyM1vioLStF/7QPQqw066tomXCgIbdPSQGPMBs/cu3Hu3OcZxF2Ojzq/6qJXQ9Rf8HsdIxPG6sSNiHc6Bzi9Km+Uk= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220628_013507_112379_49DA74F0 X-CRM114-Status: GOOD ( 25.79 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel