[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGb2v67yfWbRA4MNa2f+pAJAyiEqeCaREziaPjvGcDzTw5Za=A@mail.gmail.com>
Date: Fri, 25 Jun 2021 22:54:08 +0800
From: Chen-Yu Tsai <wens@...nel.org>
To: Sumit Garg <sumit.garg@...aro.org>
Cc: Marc Zyngier <maz@...nel.org>,
Catalin Marinas <catalin.marinas@....com>, will@...nel.org,
daniel.thompson@...aro.org, Mark Rutland <mark.rutland@....com>,
tsbogend@...ha.franken.de,
linux-kernel <linux-kernel@...r.kernel.org>,
Jason Cooper <jason@...edaemon.net>, ito-yuichi@...itsu.com,
mpe@...erman.id.au, x86@...nel.org,
Russell King <linux@...linux.org.uk>,
Douglas Anderson <dianders@...omium.org>, mingo@...hat.com,
bp@...en8.de, julien.thierry.kdev@...il.com,
jason.wessel@...driver.com, kgdb-bugreport@...ts.sourceforge.net,
Thomas Gleixner <tglx@...utronix.de>, msys.mizuma@...il.com,
David Miller <davem@...emloft.net>,
linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v7 7/7] arm64: kgdb: Roundup cpus using IPI as NMI
Hi,
On Mon, Nov 2, 2020 at 7:47 PM Sumit Garg <sumit.garg@...aro.org> wrote:
>
> arm64 platforms with GICv3 or later supports pseudo NMIs which can be
> leveraged to roundup CPUs which are stuck in hard lockup state with
> interrupts disabled that wouldn't be possible with a normal IPI.
>
> So instead switch to roundup CPUs using IPI turned as NMI. And in
> case a particular arm64 platform doesn't supports pseudo NMIs,
> it will switch back to default kgdb CPUs roundup mechanism.
>
> Signed-off-by: Sumit Garg <sumit.garg@...aro.org>
> ---
> arch/arm64/kernel/ipi_nmi.c | 5 +++++
> arch/arm64/kernel/kgdb.c | 18 ++++++++++++++++++
> 2 files changed, 23 insertions(+)
>
> diff --git a/arch/arm64/kernel/ipi_nmi.c b/arch/arm64/kernel/ipi_nmi.c
> index 597dcf7..898d69c 100644
> --- a/arch/arm64/kernel/ipi_nmi.c
> +++ b/arch/arm64/kernel/ipi_nmi.c
> @@ -8,6 +8,7 @@
>
> #include <linux/interrupt.h>
> #include <linux/irq.h>
> +#include <linux/kgdb.h>
> #include <linux/nmi.h>
> #include <linux/smp.h>
>
> @@ -45,10 +46,14 @@ bool arch_trigger_cpumask_backtrace(const cpumask_t *mask, bool exclude_self)
> static irqreturn_t ipi_nmi_handler(int irq, void *data)
> {
> irqreturn_t ret = IRQ_NONE;
> + unsigned int cpu = smp_processor_id();
>
> if (nmi_cpu_backtrace(get_irq_regs()))
> ret = IRQ_HANDLED;
>
> + if (!kgdb_nmicallback(cpu, get_irq_regs()))
This fails to compile if CONFIG_KGDB isn't enabled.
ChenYu
> + ret = IRQ_HANDLED;
> +
> return ret;
> }
>
> diff --git a/arch/arm64/kernel/kgdb.c b/arch/arm64/kernel/kgdb.c
> index 1a157ca3..371b176 100644
> --- a/arch/arm64/kernel/kgdb.c
> +++ b/arch/arm64/kernel/kgdb.c
> @@ -17,6 +17,7 @@
>
> #include <asm/debug-monitors.h>
> #include <asm/insn.h>
> +#include <asm/nmi.h>
> #include <asm/traps.h>
>
> struct dbg_reg_def_t dbg_reg_def[DBG_MAX_REG_NUM] = {
> @@ -353,3 +354,20 @@ int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt)
> return aarch64_insn_write((void *)bpt->bpt_addr,
> *(u32 *)bpt->saved_instr);
> }
> +
> +void kgdb_roundup_cpus(void)
> +{
> + struct cpumask mask;
> +
> + if (!arm64_supports_nmi()) {
> + kgdb_smp_call_nmi_hook();
> + return;
> + }
> +
> + cpumask_copy(&mask, cpu_online_mask);
> + cpumask_clear_cpu(raw_smp_processor_id(), &mask);
> + if (cpumask_empty(&mask))
> + return;
> +
> + arm64_send_nmi(&mask);
> +}
> --
> 2.7.4
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Powered by blists - more mailing lists