Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7483344rwr; Wed, 10 May 2023 08:46:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6wd7pzkUdRYmip2etGUApAgOLsvCRA0ZKAWufQ9+V08VkowTpG4wsZQ9C3WsPJKwngtAqk X-Received: by 2002:a05:6a20:4429:b0:f2:ea8e:b130 with SMTP id ce41-20020a056a20442900b000f2ea8eb130mr19934281pzb.62.1683733573879; Wed, 10 May 2023 08:46:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683733573; cv=none; d=google.com; s=arc-20160816; b=t0xFn40pOi1XBuwzTunlzIJmk5uyLaG3GbiyS3ssDL8ybpzwqiM+mGb872t19wj/pl hqyQsLuwVoK5tXEzys+emUt5RqBQilCyqoCfhNKS/loKiZb7MhPKiV0Uqay0a0HQfawZ 4G55x2paO8ME9tpzovqrjYjqS1bS4QCOSgVl1IoU8dpa+D4s5SRJ8ifWAbY+9H9YWzYa BPiLE5mEi3sqaIA2F4FJ63DbypKk6Bir3Si1QGaYhg8qXOKhY+cJ61gTD5xpz64rCXLM htPiTyAwvAywZHhX3SGQuZyUgxZBEOpkvZj0nDZcgvKHWUa84wDh3CpEyttOlJ1ohUEh ICfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=qzhn1S4hfKcOd1E/ek0bvXDc8iMvqfYzj4agdzIw7zg=; b=BWNtom+F3H9eVqtFZp7ehqxQhYDL7rzcjZMxZEyQe1xLwQy+3zgxKTWDNFKThHWL0W Umo7BqhBJfsxniKHq00uPST6cmmPTSzyAQd/f/CS8k2yPYefpDHRJ0pt2LH6Df/lEjeA dL2Sjonv3C5/1WMYVB7ktlKL3pwNBQPBET5R70f6mg70v7vMb7N9xpPIhZzlgnqILB+z mPEU5GPLB98ba8BZTfwLRJy68w1acaloj0g65c2q0/2Af0mmLMLJbO1N9bJpoJ1eUbUR w4NDSowzZNltyttbd7+HZcl47Xp+98WAE75QEHxVixhJHTC3nHjnSN+wGhrPe2EaEY2Q 1bfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=egRCEgNc; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z185-20020a6265c2000000b006439d7f4150si5063255pfb.352.2023.05.10.08.45.59; Wed, 10 May 2023 08:46:13 -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=@chromium.org header.s=google header.b=egRCEgNc; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237269AbjEJPgf (ORCPT + 99 others); Wed, 10 May 2023 11:36:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236614AbjEJPgd (ORCPT ); Wed, 10 May 2023 11:36:33 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 720B12D66 for ; Wed, 10 May 2023 08:36:31 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-50b9ef67f35so13199912a12.2 for ; Wed, 10 May 2023 08:36:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1683732989; x=1686324989; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=qzhn1S4hfKcOd1E/ek0bvXDc8iMvqfYzj4agdzIw7zg=; b=egRCEgNcEW1A3AXd0hvy/3Q+t+UZtpUtwzg8cfxE/riXg5ELdKKuara8whwNmffDG9 fMFJJvFOgRl417VsRAYzn9tLr1Egb5ESRCthBw5jxE99CN9VZld4V6ifYIkjpNHvOcab IVg1kTTlrFHZ1CME7lpSxiLuQm2plzUdzujZ0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683732989; x=1686324989; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qzhn1S4hfKcOd1E/ek0bvXDc8iMvqfYzj4agdzIw7zg=; b=RL53tVGJQ4smr3CZTP30qfbrNob/3C/yFGAr2Za2ldKrDmOtnkleIbe29hCIJag1/A X+aCGFf9OYHAal5LiI7TlCZplX6lVByt/zZr4F93wr/xfTmVV8poL5oyGNJrV/V3Iti2 mZjJM2dB8BpkmMk6yfDS2CC0TFx38hlsBK8A41jVmsHibzebvtfWp56cl52sZmgambgj 9ZWWzV4fH5im5HRNHs3gpKF9/0/IxiHXKf5q5s0a6OSc/rqM7asVO6E3cUGoUXFGPAt2 P+C/dMVab//yiLa1ecDVGzq+pfZ7brILuLMBiGWAgmZzmltCwMyrv4NZpTtIqusIppRJ 4ybA== X-Gm-Message-State: AC+VfDywFA2PffUEwJDGxRrKziuHCADjF00Nv+0JXaId2IHJD21AoNKe v6QAdGhN21TYsEubowhovnBMwOFAk4hgT6WxFc9MIQ== X-Received: by 2002:aa7:ca57:0:b0:50c:1e2:4a42 with SMTP id j23-20020aa7ca57000000b0050c01e24a42mr14662041edt.15.1683732989533; Wed, 10 May 2023 08:36:29 -0700 (PDT) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com. [209.85.128.51]) by smtp.gmail.com with ESMTPSA id a17-20020aa7d751000000b0050d988bf956sm2038352eds.45.2023.05.10.08.36.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 May 2023 08:36:29 -0700 (PDT) Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-3f2548256d0so120095e9.1 for ; Wed, 10 May 2023 08:36:29 -0700 (PDT) X-Received: by 2002:a05:600c:600f:b0:3f1:6fe9:4a98 with SMTP id az15-20020a05600c600f00b003f16fe94a98mr178073wmb.5.1683732511119; Wed, 10 May 2023 08:28:31 -0700 (PDT) MIME-Version: 1.0 References: <20230419225604.21204-1-dianders@chromium.org> In-Reply-To: <20230419225604.21204-1-dianders@chromium.org> From: Doug Anderson Date: Wed, 10 May 2023 08:28:17 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v8 00/10] arm64: Add framework to turn an IPI as NMI To: Catalin Marinas , Will Deacon , Sumit Garg , Daniel Thompson , Marc Zyngier , Mark Rutland Cc: ito-yuichi@fujitsu.com, kgdb-bugreport@lists.sourceforge.net, Chen-Yu Tsai , Masayoshi Mizuma , Peter Zijlstra , Ard Biesheuvel , "Rafael J . Wysocki" , linux-arm-kernel@lists.infradead.org, Stephen Boyd , Lecopzer Chen , Thomas Gleixner , linux-perf-users@vger.kernel.org, Alexandru Elisei , Andrey Konovalov , Ben Dooks , Borislav Petkov , Christophe Leroy , "Darrick J. Wong" , Dave Hansen , "David S. Miller" , "Eric W. Biederman" , Frederic Weisbecker , Gaosheng Cui , "Gautham R. Shenoy" , Greg Kroah-Hartman , "Guilherme G. Piccoli" , Guo Ren , "H. Peter Anvin" , Huacai Chen , Ingo Molnar , Ingo Molnar , "Jason A. Donenfeld" , Jason Wessel , Jianmin Lv , Jiaxun Yang , Jinyang He , Joey Gouly , Kees Cook , Laurent Dufour , Masahiro Yamada , Masayoshi Mizuma , Michael Ellerman , Nicholas Piggin , "Paul E. McKenney" , =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= , Pierre Gondois , Qing Zhang , "Russell King (Oracle)" , Russell King , Thomas Bogendoerfer , Ulf Hansson , WANG Xuerui , linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, loongarch@lists.linux.dev, sparclinux@vger.kernel.org, x86@kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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 Hi, On Wed, Apr 19, 2023 at 3:57=E2=80=AFPM Douglas Anderson wrote: > > This is an attempt to resurrect Sumit's old patch series [1] that > allowed us to use the arm64 pseudo-NMI to get backtraces of CPUs and > also to round up CPUs in kdb/kgdb. The last post from Sumit that I > could find was v7, so I called this series v8. I haven't copied all of > his old changelongs here, but you can find them from the link. > > Since v7, I have: > * Addressed the small amount of feedback that was there for v7. > * Rebased. > * Added a new patch that prevents us from spamming the logs with idle > tasks. > * Added an extra patch to gracefully fall back to regular IPIs if > pseudo-NMIs aren't there. > > Since there appear to be a few different patches series related to > being able to use NMIs to get stack traces of crashed systems, let me > try to organize them to the best of my understanding: > > a) This series. On its own, a) will (among other things) enable stack > traces of all running processes with the soft lockup detector if > you've enabled the sysctl "kernel.softlockup_all_cpu_backtrace". On > its own, a) doesn't give a hard lockup detector. > > b) A different recently-posted series [2] that adds a hard lockup > detector based on perf. On its own, b) gives a stack crawl of the > locked up CPU but no stack crawls of other CPUs (even if they're > locked too). Together with a) + b) we get everything (full lockup > detect, full ability to get stack crawls). > > c) The old Android "buddy" hard lockup detector [3] that I'm > considering trying to upstream. If b) lands then I believe c) would > be redundant (at least for arm64). c) on its own is really only > useful on arm64 for platforms that can print CPU_DBGPCSR somehow > (see [4]). a) + c) is roughly as good as a) + b). > > [1] https://lore.kernel.org/linux-arm-kernel/1604317487-14543-1-git-send-= email-sumit.garg@linaro.org/ > [2] https://lore.kernel.org/linux-arm-kernel/20220903093415.15850-1-lecop= zer.chen@mediatek.com/ > [3] https://issuetracker.google.com/172213097 > [4] https://issuetracker.google.com/172213129 > > Changes in v8: > - dynamic_ipi_setup() and dynamic_ipi_teardown() no longer take cpu param > - dynamic_ipi_setup() and dynamic_ipi_teardown() no longer take cpu param > - Add loongarch support, too > - Removed "#ifdef CONFIG_SMP" since arm64 is always SMP > - "Tag the arm64 idle functions as __cpuidle" new for v8 > - "Provide a stub kgdb_nmicallback() if !CONFIG_KGDB" new for v8 > - "Fallback to a regular IPI if NMI isn't enabled" new for v8 > > Douglas Anderson (3): > arm64: idle: Tag the arm64 idle functions as __cpuidle > kgdb: Provide a stub kgdb_nmicallback() if !CONFIG_KGDB > arm64: ipi_nmi: Fallback to a regular IPI if NMI isn't enabled > > Sumit Garg (7): > arm64: Add framework to turn IPI as NMI > irqchip/gic-v3: Enable support for SGIs to act as NMIs > arm64: smp: Assign and setup an IPI as NMI > nmi: backtrace: Allow runtime arch specific override > arm64: ipi_nmi: Add support for NMI backtrace > kgdb: Expose default CPUs roundup fallback mechanism > arm64: kgdb: Roundup cpus using IPI as NMI > > arch/arm/include/asm/irq.h | 2 +- > arch/arm/kernel/smp.c | 3 +- > arch/arm64/include/asm/irq.h | 4 ++ > arch/arm64/include/asm/nmi.h | 17 +++++ > arch/arm64/kernel/Makefile | 2 +- > arch/arm64/kernel/idle.c | 4 +- > arch/arm64/kernel/ipi_nmi.c | 103 +++++++++++++++++++++++++++++++ > arch/arm64/kernel/kgdb.c | 18 ++++++ > arch/arm64/kernel/smp.c | 8 +++ > arch/loongarch/include/asm/irq.h | 2 +- > arch/loongarch/kernel/process.c | 3 +- > arch/mips/include/asm/irq.h | 2 +- > arch/mips/kernel/process.c | 3 +- > arch/powerpc/include/asm/nmi.h | 2 +- > arch/powerpc/kernel/stacktrace.c | 3 +- > arch/sparc/include/asm/irq_64.h | 2 +- > arch/sparc/kernel/process_64.c | 4 +- > arch/x86/include/asm/irq.h | 2 +- > arch/x86/kernel/apic/hw_nmi.c | 3 +- > drivers/irqchip/irq-gic-v3.c | 29 ++++++--- > include/linux/kgdb.h | 13 ++++ > include/linux/nmi.h | 12 ++-- > kernel/debug/debug_core.c | 8 ++- > 23 files changed, 217 insertions(+), 32 deletions(-) It's been 3 weeks and I haven't heard a peep on this series. That means nobody has any objections and it's all good to land, right? Right? :-P Seriously, though, I really think we should figure out how to get this landed. There's obviously interest from several different parties and I'm chomping at the bit waiting to spin this series according to your wishes. I also don't think there's anything super scary/ugly here. IMO the ideal situation is that folks are OK with the idea presented in the last patch in the series ("arm64: ipi_nmi: Fallback to a regular IPI if NMI isn't enabled") and then I can re-spin this series to be _much_ simpler. That being said, I'm also OK with dropping that patch and starting the discussion for how to land the rest of the patches in the series. Please let me know! -Doug