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=-9.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 7D5E2C433E7 for ; Thu, 15 Oct 2020 01:18:58 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 182BF22254 for ; Thu, 15 Oct 2020 01:18:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tNyDOUg4"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Axt5o00P" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 182BF22254 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=SDrcDeTpNeK/lKql8ST99YQeOaRBteJHxPd6u7BWrrw=; b=tNyDOUg4UFc+PuCyF9m1IdCb1 B8PF8mhm9z44WN25Xo2R0iO+RoCaBrRFRNCkmpXscRuDqMzqTDNB/g8LgHfc5Oz8gldnwbbbE2vLN OziryRuXK0041+u9nUZASkk6+GdNY46wQma1lC2R0XIuTSliR8O3BKHsYftLxT7n3DhB5xJuA3bCj K4+MOJJqPasOT0RjvS9mKCpA83sVABKgKqPUZZzl0Wqh973hIkH9zBbv+D7VPCYfSjtfwoYmfrE3v J8gBRhjDbqvzAHWs164f7Dvc2zz2DYBwevXNbkUv/+Rqx787Ho9F8oyiUXsLJcKIjS7N6V0Fg11DP 5a6TYmSdw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSrtk-0004yN-Sg; Thu, 15 Oct 2020 01:17:40 +0000 Received: from mail-il1-x144.google.com ([2607:f8b0:4864:20::144]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSrtj-0004xc-0M for linux-arm-kernel@lists.infradead.org; Thu, 15 Oct 2020 01:17:39 +0000 Received: by mail-il1-x144.google.com with SMTP id q1so2229948ilt.6 for ; Wed, 14 Oct 2020 18:17:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=gRUP5okLmkN2g8HT3wDw7jtbqT5ZCqE5twgUzt6/004=; b=Axt5o00Pp6mgZRePuxQ5jTc1tIKAoWXVLza1VeaVWSk6EHkD9m3LvdYCBhVdhLLgoB EQRKLb094zduDRN9Wgbho3j6WZQDmrKDR7znzAacxGZQxfgFDC0HAzPe8hwst1K0uiLT MJVf9n3dWZ0RalrPKjJj/UZkTZ+8406R/J3fLX5ybJUNt+xLfuyN1t4YZe3JntgAuiB2 FipSBtW0NeTqwAgrpMsn3HBEbu47epCFqA+lT0fkyRsFFdEC2PtJIWJRjEb1va8tDGCK AwQUbhWsIw9nEef0g5BPYmAf6qPLpwcG91sq19Erz9RfJL6FcUJpH+0DHCFGq6vGs2re nwew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gRUP5okLmkN2g8HT3wDw7jtbqT5ZCqE5twgUzt6/004=; b=bjyu4oSazyRF45k06tIUAFRxWl885tvKg0v6rtKJacGpm7ps5Pu+zP5LTYBrfgIPHw v0QYSs/PsnSBDDwgju5KJeHcbb/mhYRFut9iHcGlfOoiKyuEx56lp5fN8vlyiqGmNB6m c96vmEJ3P0cHHG3HqkXYbR2b1x57/HGrXqnQT8FKNErITjsRiICgHakoSNmtDsKifGB4 tZKpGXrwA3MAaSdlLJ8Rg2wDSSVqEADGj0HqV+HtMf9WRXfX7oSHLKkGM4tjx4fiKRB8 /j4AOfzoHDb0H688ZXfBHl5T/ujqba3T+vk3wlSxzG7lRHQ8qjSHMDBfSEaIGMBQRCwv yzbQ== X-Gm-Message-State: AOAM533QXT1QBXHE+taHjj22JudmyUSuBnd10P+Tu7wlj2M6KfL82awc OzZGodwRoz/C8NPNmGR3vw== X-Google-Smtp-Source: ABdhPJwmPHN+xkaMEX00WKdHeJam3q4KuADGTGUWoOIWFo6TRZqa0MG79tQKSWB3WJHYAYtmTO/owA== X-Received: by 2002:a92:ca92:: with SMTP id t18mr1413551ilo.287.1602724657601; Wed, 14 Oct 2020 18:17:37 -0700 (PDT) Received: from gabell (209-6-122-159.s2973.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [209.6.122.159]) by smtp.gmail.com with ESMTPSA id o17sm1148985ila.47.2020.10.14.18.17.32 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Oct 2020 18:17:33 -0700 (PDT) Date: Wed, 14 Oct 2020 21:17:30 -0400 From: Masayoshi Mizuma To: Sumit Garg Subject: Re: [PATCH v5 5/5] arm64: ipi_nmi: Add support for NMI backtrace Message-ID: <20201015011730.mbhbxr2zgjfe2zen@gabell> References: <1602673931-28782-1-git-send-email-sumit.garg@linaro.org> <1602673931-28782-6-git-send-email-sumit.garg@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1602673931-28782-6-git-send-email-sumit.garg@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201014_211739_079234_D9C2AD73 X-CRM114-Status: GOOD ( 20.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, daniel.thompson@linaro.org, ito-yuichi@fujitsu.com, jason@lakedaemon.net, maz@kernel.org, jason.wessel@windriver.com, dianders@chromium.org, linux-kernel@vger.kernel.org, julien.thierry.kdev@gmail.com, catalin.marinas@arm.com, kgdb-bugreport@lists.sourceforge.net, tglx@linutronix.de, will@kernel.org, linux-arm-kernel@lists.infradead.org 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 Wed, Oct 14, 2020 at 04:42:11PM +0530, Sumit Garg wrote: > Enable NMI backtrace support on arm64 using IPI turned as an NMI > leveraging pseudo NMIs support. It is now possible for users to get a > backtrace of a CPU stuck in hard-lockup using magic SYSRQ. > > Signed-off-by: Sumit Garg > --- > arch/arm64/include/asm/irq.h | 6 ++++++ > arch/arm64/kernel/ipi_nmi.c | 12 +++++++++++- > 2 files changed, 17 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/include/asm/irq.h b/arch/arm64/include/asm/irq.h > index b2b0c64..e840bf1 100644 > --- a/arch/arm64/include/asm/irq.h > +++ b/arch/arm64/include/asm/irq.h > @@ -6,6 +6,12 @@ > > #include > > +#ifdef CONFIG_SMP > +extern void arch_trigger_cpumask_backtrace(const cpumask_t *mask, > + bool exclude_self); > +#define arch_trigger_cpumask_backtrace arch_trigger_cpumask_backtrace > +#endif > + > struct pt_regs; > > static inline int nr_legacy_irqs(void) > diff --git a/arch/arm64/kernel/ipi_nmi.c b/arch/arm64/kernel/ipi_nmi.c > index e0a9e03..e1dc19d 100644 > --- a/arch/arm64/kernel/ipi_nmi.c > +++ b/arch/arm64/kernel/ipi_nmi.c > @@ -9,6 +9,7 @@ > #include > #include > #include > +#include > #include > > #include > @@ -25,12 +26,21 @@ void arch_send_call_nmi_func_ipi_mask(cpumask_t *mask) > __ipi_send_mask(ipi_desc, mask); > } > > +void arch_trigger_cpumask_backtrace(const cpumask_t *mask, bool exclude_self) > +{ > + nmi_trigger_cpumask_backtrace(mask, exclude_self, > + arch_send_call_nmi_func_ipi_mask); > +} > + > static irqreturn_t ipi_nmi_handler(int irq, void *data) > { > unsigned int cpu = smp_processor_id(); > > - ipi_kgdb_nmicallback(cpu, get_irq_regs()); > + if (nmi_cpu_backtrace(get_irq_regs())) > + goto out; > > + ipi_kgdb_nmicallback(cpu, get_irq_regs()); > +out: > return IRQ_HANDLED; > } > > -- It works well. Please feel free to add: Tested-by: Masayoshi Mizuma Thanks! Masa _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel