* [PATCH v3] parisc: Add raise_nmi() and arch_trigger_cpumask_backtrace()
@ 2020-08-14 13:20 Helge Deller
0 siblings, 0 replies; only message in thread
From: Helge Deller @ 2020-08-14 13:20 UTC (permalink / raw)
To: linux-parisc
Implement the parisc versions for raise_nmi() and arch_trigger_cpumask_backtrace()
functions to provide IPI-triggered per-CPU backtrace printouts.
Signed-off-by: Helge Deller <deller@gmx.de>
diff --git a/arch/parisc/include/asm/irq.h b/arch/parisc/include/asm/irq.h
index 959e79cd2c14..c978d50bd29e 100644
--- a/arch/parisc/include/asm/irq.h
+++ b/arch/parisc/include/asm/irq.h
@@ -50,4 +50,10 @@ extern int cpu_check_affinity(struct irq_data *d, const struct cpumask *dest);
/* soft power switch support (power.c) */
extern struct tasklet_struct power_tasklet;
+#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
+
#endif /* _ASM_PARISC_IRQ_H */
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index 6271139d2213..cd7694497428 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -29,6 +29,7 @@
#include <linux/bitops.h>
#include <linux/ftrace.h>
#include <linux/cpu.h>
+#include <linux/nmi.h>
#include <linux/atomic.h>
#include <asm/current.h>
@@ -69,6 +70,7 @@ enum ipi_message_type {
IPI_CALL_FUNC,
IPI_CPU_START,
IPI_CPU_STOP,
+ IPI_CPU_BACKTRACE,
IPI_CPU_TEST
};
@@ -164,6 +166,14 @@ ipi_interrupt(int irq, void *dev_id)
halt_processor();
break;
+ case IPI_CPU_BACKTRACE:
+ printk_nmi_enter();
+ irq_enter();
+ nmi_cpu_backtrace(get_irq_regs());
+ irq_exit();
+ printk_nmi_exit();
+ break;
+
case IPI_CPU_TEST:
smp_debug(100, KERN_DEBUG "CPU%d is alive!\n", this_cpu);
break;
@@ -246,6 +259,16 @@ void arch_send_call_function_single_ipi(int cpu)
send_IPI_single(cpu, IPI_CALL_FUNC);
}
+static void raise_nmi(cpumask_t *mask)
+{
+ send_IPI_mask(mask, IPI_CPU_BACKTRACE);
+}
+
+void arch_trigger_cpumask_backtrace(const cpumask_t *mask, bool exclude_self)
+{
+ nmi_trigger_cpumask_backtrace(mask, exclude_self, raise_nmi);
+}
+
/*
* Called by secondaries to update state and initialize CPU registers.
*/
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-08-14 13:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-14 13:20 [PATCH v3] parisc: Add raise_nmi() and arch_trigger_cpumask_backtrace() Helge Deller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).