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 X-Spam-Level: X-Spam-Status: No, score=-20.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E039C2B9F4 for ; Fri, 25 Jun 2021 13:35:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 311936197D for ; Fri, 25 Jun 2021 13:35:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231718AbhFYNhV (ORCPT ); Fri, 25 Jun 2021 09:37:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231621AbhFYNhT (ORCPT ); Fri, 25 Jun 2021 09:37:19 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C70E3C061574 for ; Fri, 25 Jun 2021 06:34:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ze0cDzN8bUMWNAl+8iRscpck4qNLSArRApI/uLhLSvA=; b=xyD1AXSpkRsKpDvRdFL6DY1wE QdnGUr1a/XUiGlKDRfbCdxgTTbwOlcFRtBWTFDGFW/VXc0gpsbyO1rqTIQJX94k0OSyGr2p8oEueK AChEsxADklDoe1x1iN0Oaoeyg6WjvdGQT23zJAe2jQE0E6SEnZce7R+9uySj37XfucJP00XsJ2ejY oPAywWjYsv1iDHwhJI7YAN6gFAIQpEtBdrwfcyfbNOONqBIQVwP2ZTCPBolPyBU4/1htPwptfcZ9u bj3DyTr5VvLmC163GIPZYgZpZ2VXBG9ILmC2uUvFfNCj3p8af1GQX/3yW1wpeMiR3HETaiO9NUoe8 9JBmyjlyA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:45352) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lwlyY-0000mV-Hr; Fri, 25 Jun 2021 14:34:30 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1lwlyT-0006iE-6d; Fri, 25 Jun 2021 14:34:25 +0100 Date: Fri, 25 Jun 2021 14:34:25 +0100 From: "Russell King (Oracle)" To: Petr Mladek Cc: John Ogness , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Ingo Molnar , Marc Zyngier , Valentin Schneider , Andrew Morton , Pekka Enberg , Mike Rapoport , "Wolfram Sang (Renesas)" , Anshuman Khandual , Peter Zijlstra , Frederic Weisbecker , Kees Cook , Masahiro Yamada , Nathan Chancellor , Sami Tolvanen , Alexei Starovoitov , Nick Terrell , Chris Wilson , Vlastimil Babka , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH printk v3 4/6] printk: remove NMI tracking Message-ID: <20210625133425.GX22278@shell.armlinux.org.uk> References: <20210624111148.5190-1-john.ogness@linutronix.de> <20210624111148.5190-5-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 25, 2021 at 02:36:23PM +0200, Petr Mladek wrote: > On Thu 2021-06-24 13:17:46, John Ogness wrote: > > All NMI contexts are handled the same as the safe context: store the > > message and defer printing. There is no need to have special NMI > > context tracking for this. Using in_nmi() is enough. > > > > Signed-off-by: John Ogness > > Reviewed-by: Petr Mladek > > --- > > arch/arm/kernel/smp.c | 2 -- > > arch/powerpc/kexec/crash.c | 3 --- > > include/linux/hardirq.h | 2 -- > > include/linux/printk.h | 12 ------------ > > init/Kconfig | 5 ----- > > kernel/printk/internal.h | 6 ------ > > kernel/printk/printk_safe.c | 37 +------------------------------------ > > kernel/trace/trace.c | 2 -- > > 8 files changed, 1 insertion(+), 68 deletions(-) > > > > diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c > > index 74679240a9d8..0dd2d733ad62 100644 > > --- a/arch/arm/kernel/smp.c > > +++ b/arch/arm/kernel/smp.c > > @@ -668,9 +668,7 @@ static void do_handle_IPI(int ipinr) > > break; > > > > case IPI_CPU_BACKTRACE: > > - printk_nmi_enter(); > > nmi_cpu_backtrace(get_irq_regs()); > > - printk_nmi_exit(); > > It looks to me that in_nmi() returns false here. As a result, > nmi_cpu_backtrace() might newly call consoles immediately. > > If I recall correctly, arm does not have a proper NMI. > And this is just some special case of a "normal" IRQ. > > And indeed, nmi_enter() is called only from handle_fiq_as_nmi() > and it is just a boiler plate. > > If I am right, we should replace printk_nmi_enter() with > printk_safe_enter_irqsave(flags) or so. > > Even better solution might be to call this within > nmi_enter()/nmi_exit(). But I am not sure if this is what > the arm people want. As I seem to recall, the guy in ARM Ltd who was working on this seemed to drift away and it never got finished - however, I've always carried platform specific hacks in my tree to make this work from FIQ on the platforms I cared about: http://git.armlinux.org.uk/cgit/linux-arm.git/commit/?h=fiq Not suitable for mainline like that. I'm not aware of anyone working on it now. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! 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 X-Spam-Level: X-Spam-Status: No, score=-20.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B00AEC2B9F4 for ; Fri, 25 Jun 2021 13:35:34 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E0259616E8 for ; Fri, 25 Jun 2021 13:35:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E0259616E8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4GBJ0j3TRdz3c2H for ; Fri, 25 Jun 2021 23:35:33 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.a=rsa-sha256 header.s=pandora-2019 header.b=xyD1AXSp; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=armlinux.org.uk (client-ip=2001:4d48:ad52:32c8:5054:ff:fe00:142; helo=pandora.armlinux.org.uk; envelope-from=linux+linuxppc-dev=lists.ozlabs.org@armlinux.org.uk; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.a=rsa-sha256 header.s=pandora-2019 header.b=xyD1AXSp; dkim-atps=neutral Received: from pandora.armlinux.org.uk (unknown [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4GBJ046WJLz3brt for ; Fri, 25 Jun 2021 23:34:52 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ze0cDzN8bUMWNAl+8iRscpck4qNLSArRApI/uLhLSvA=; b=xyD1AXSpkRsKpDvRdFL6DY1wE QdnGUr1a/XUiGlKDRfbCdxgTTbwOlcFRtBWTFDGFW/VXc0gpsbyO1rqTIQJX94k0OSyGr2p8oEueK AChEsxADklDoe1x1iN0Oaoeyg6WjvdGQT23zJAe2jQE0E6SEnZce7R+9uySj37XfucJP00XsJ2ejY oPAywWjYsv1iDHwhJI7YAN6gFAIQpEtBdrwfcyfbNOONqBIQVwP2ZTCPBolPyBU4/1htPwptfcZ9u bj3DyTr5VvLmC163GIPZYgZpZ2VXBG9ILmC2uUvFfNCj3p8af1GQX/3yW1wpeMiR3HETaiO9NUoe8 9JBmyjlyA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:45352) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lwlyY-0000mV-Hr; Fri, 25 Jun 2021 14:34:30 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1lwlyT-0006iE-6d; Fri, 25 Jun 2021 14:34:25 +0100 Date: Fri, 25 Jun 2021 14:34:25 +0100 From: "Russell King (Oracle)" To: Petr Mladek Subject: Re: [PATCH printk v3 4/6] printk: remove NMI tracking Message-ID: <20210625133425.GX22278@shell.armlinux.org.uk> References: <20210624111148.5190-1-john.ogness@linutronix.de> <20210624111148.5190-5-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Zijlstra , Alexei Starovoitov , Chris Wilson , "Wolfram Sang \(Renesas\)" , Paul Mackerras , Marc Zyngier , Masahiro Yamada , Ingo Molnar , linux-arm-kernel@lists.infradead.org, Sami Tolvanen , Valentin Schneider , Kees Cook , John Ogness , Anshuman Khandual , Frederic Weisbecker , Steven Rostedt , Nathan Chancellor , Nick Terrell , Thomas Gleixner , Vlastimil Babka , linux-kernel@vger.kernel.org, Pekka Enberg , Sergey Senozhatsky , Andrew Morton , linuxppc-dev@lists.ozlabs.org, Mike Rapoport Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, Jun 25, 2021 at 02:36:23PM +0200, Petr Mladek wrote: > On Thu 2021-06-24 13:17:46, John Ogness wrote: > > All NMI contexts are handled the same as the safe context: store the > > message and defer printing. There is no need to have special NMI > > context tracking for this. Using in_nmi() is enough. > > > > Signed-off-by: John Ogness > > Reviewed-by: Petr Mladek > > --- > > arch/arm/kernel/smp.c | 2 -- > > arch/powerpc/kexec/crash.c | 3 --- > > include/linux/hardirq.h | 2 -- > > include/linux/printk.h | 12 ------------ > > init/Kconfig | 5 ----- > > kernel/printk/internal.h | 6 ------ > > kernel/printk/printk_safe.c | 37 +------------------------------------ > > kernel/trace/trace.c | 2 -- > > 8 files changed, 1 insertion(+), 68 deletions(-) > > > > diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c > > index 74679240a9d8..0dd2d733ad62 100644 > > --- a/arch/arm/kernel/smp.c > > +++ b/arch/arm/kernel/smp.c > > @@ -668,9 +668,7 @@ static void do_handle_IPI(int ipinr) > > break; > > > > case IPI_CPU_BACKTRACE: > > - printk_nmi_enter(); > > nmi_cpu_backtrace(get_irq_regs()); > > - printk_nmi_exit(); > > It looks to me that in_nmi() returns false here. As a result, > nmi_cpu_backtrace() might newly call consoles immediately. > > If I recall correctly, arm does not have a proper NMI. > And this is just some special case of a "normal" IRQ. > > And indeed, nmi_enter() is called only from handle_fiq_as_nmi() > and it is just a boiler plate. > > If I am right, we should replace printk_nmi_enter() with > printk_safe_enter_irqsave(flags) or so. > > Even better solution might be to call this within > nmi_enter()/nmi_exit(). But I am not sure if this is what > the arm people want. As I seem to recall, the guy in ARM Ltd who was working on this seemed to drift away and it never got finished - however, I've always carried platform specific hacks in my tree to make this work from FIQ on the platforms I cared about: http://git.armlinux.org.uk/cgit/linux-arm.git/commit/?h=fiq Not suitable for mainline like that. I'm not aware of anyone working on it now. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! 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 X-Spam-Level: X-Spam-Status: No, score=-20.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F916C49EA7 for ; Fri, 25 Jun 2021 13:36:08 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 2D2A261981 for ; Fri, 25 Jun 2021 13:36:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2D2A261981 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=axjyuiHstRWVG+Mpncxh96FAkelV49Ct4/i9zlywAYU=; b=CbfhAQIa+VkNjS I6qHx7LFBUtJ776K9uM0DNCIMpEQnwiM+MX2Z7chFjpKupttGusXb/5V/nEyGJndxxVDVt06ctn8+ JblwIvCCqkXkxEHKBEm6HxPqIdnr2RR0VRyut4BEGo3mWs57+oTMcAszHCeTAnmZmppi9eI48fICD m4O3Uor5rmY/qM5sYjyCLBMCM4o9X0qTLsOQKHP413SB4o65DttMTtwOjXtpKBVfyWuaxOcVEPsyQ Q0kcIroOY49yYGnN3G6nS+g7L2PnlBitEBiEU492GI81SR+0yEq7UJ90TDSiI5dute9xj7GUygXHE mhvUE94gN6hnNfm2zXow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwlyn-001hGW-DH; Fri, 25 Jun 2021 13:34:45 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwlyj-001hFh-CQ for linux-arm-kernel@lists.infradead.org; Fri, 25 Jun 2021 13:34:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ze0cDzN8bUMWNAl+8iRscpck4qNLSArRApI/uLhLSvA=; b=xyD1AXSpkRsKpDvRdFL6DY1wE QdnGUr1a/XUiGlKDRfbCdxgTTbwOlcFRtBWTFDGFW/VXc0gpsbyO1rqTIQJX94k0OSyGr2p8oEueK AChEsxADklDoe1x1iN0Oaoeyg6WjvdGQT23zJAe2jQE0E6SEnZce7R+9uySj37XfucJP00XsJ2ejY oPAywWjYsv1iDHwhJI7YAN6gFAIQpEtBdrwfcyfbNOONqBIQVwP2ZTCPBolPyBU4/1htPwptfcZ9u bj3DyTr5VvLmC163GIPZYgZpZ2VXBG9ILmC2uUvFfNCj3p8af1GQX/3yW1wpeMiR3HETaiO9NUoe8 9JBmyjlyA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:45352) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lwlyY-0000mV-Hr; Fri, 25 Jun 2021 14:34:30 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1lwlyT-0006iE-6d; Fri, 25 Jun 2021 14:34:25 +0100 Date: Fri, 25 Jun 2021 14:34:25 +0100 From: "Russell King (Oracle)" To: Petr Mladek Cc: John Ogness , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Ingo Molnar , Marc Zyngier , Valentin Schneider , Andrew Morton , Pekka Enberg , Mike Rapoport , "Wolfram Sang (Renesas)" , Anshuman Khandual , Peter Zijlstra , Frederic Weisbecker , Kees Cook , Masahiro Yamada , Nathan Chancellor , Sami Tolvanen , Alexei Starovoitov , Nick Terrell , Chris Wilson , Vlastimil Babka , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH printk v3 4/6] printk: remove NMI tracking Message-ID: <20210625133425.GX22278@shell.armlinux.org.uk> References: <20210624111148.5190-1-john.ogness@linutronix.de> <20210624111148.5190-5-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210625_063441_483185_9498342E X-CRM114-Status: GOOD ( 27.00 ) 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 25, 2021 at 02:36:23PM +0200, Petr Mladek wrote: > On Thu 2021-06-24 13:17:46, John Ogness wrote: > > All NMI contexts are handled the same as the safe context: store the > > message and defer printing. There is no need to have special NMI > > context tracking for this. Using in_nmi() is enough. > > > > Signed-off-by: John Ogness > > Reviewed-by: Petr Mladek > > --- > > arch/arm/kernel/smp.c | 2 -- > > arch/powerpc/kexec/crash.c | 3 --- > > include/linux/hardirq.h | 2 -- > > include/linux/printk.h | 12 ------------ > > init/Kconfig | 5 ----- > > kernel/printk/internal.h | 6 ------ > > kernel/printk/printk_safe.c | 37 +------------------------------------ > > kernel/trace/trace.c | 2 -- > > 8 files changed, 1 insertion(+), 68 deletions(-) > > > > diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c > > index 74679240a9d8..0dd2d733ad62 100644 > > --- a/arch/arm/kernel/smp.c > > +++ b/arch/arm/kernel/smp.c > > @@ -668,9 +668,7 @@ static void do_handle_IPI(int ipinr) > > break; > > > > case IPI_CPU_BACKTRACE: > > - printk_nmi_enter(); > > nmi_cpu_backtrace(get_irq_regs()); > > - printk_nmi_exit(); > > It looks to me that in_nmi() returns false here. As a result, > nmi_cpu_backtrace() might newly call consoles immediately. > > If I recall correctly, arm does not have a proper NMI. > And this is just some special case of a "normal" IRQ. > > And indeed, nmi_enter() is called only from handle_fiq_as_nmi() > and it is just a boiler plate. > > If I am right, we should replace printk_nmi_enter() with > printk_safe_enter_irqsave(flags) or so. > > Even better solution might be to call this within > nmi_enter()/nmi_exit(). But I am not sure if this is what > the arm people want. As I seem to recall, the guy in ARM Ltd who was working on this seemed to drift away and it never got finished - however, I've always carried platform specific hacks in my tree to make this work from FIQ on the platforms I cared about: http://git.armlinux.org.uk/cgit/linux-arm.git/commit/?h=fiq Not suitable for mainline like that. I'm not aware of anyone working on it now. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel