IPI calltraces on x86_64
PATCH 1/1 IPI calltraces on x86_64
[PATCH] IPI calltraces on x86_64
This patch makes x86_64 kernel to print calltraces on _all_ CPUs on Alt-SysRq-p and NMI LOCKUP.
This patch supplements the one made for i386
some time ago and included in -mm tree.
Since it proved its usefullness many times already we did the same patch for x86_64.
arch/x86_64/kernel/nmi.c renamed from arch/x86_64/kernel/nmi.c.ve129 +13 -0
@@ -522,6 +522,7 @@ static __kprobes int dummy_nmi_callback( }static nmi_callback_t nmi_callback = dummy_nmi_callback; +static nmi_callback_t nmi_ipi_callback = dummy_nmi_callback; asmlinkage __kprobes void do_nmi(struct pt_regs * regs, long error_code) {
@@ -531,9 +532,21 @@ asmlinkage __kprobes void do_nmi(structadd_pda (__nmi_count,1 );if (!rcu_dereference (nmi_callback)(regs, cpu))default_do_nmi (regs); + +nmi_ipi_callback (regs, cpu);nmi_exit (); } +void set_nmi_ipi_callback (nmi_callback_t callback) +{ + nmi_ipi_callback = callback; +} + +void unset_nmi_ipi_callback (void ) +{ + nmi_ipi_callback = dummy_nmi_callback; +} +void set_nmi_callback (nmi_callback_t callback) {rcu_assign_pointer (nmi_callback, callback);
arch/x86_64/kernel/process.c renamed from arch/x86_64/kernel/process.c.ve129 +15 -0
@@ -345,6 +345,21 @@ void show_regs(struct pt_regs *regs)show_trace (®s->rsp); } +void smp_show_regs (struct pt_regs *regs,void *data) +{ +static DEFINE_SPINLOCK (show_regs_lock); + +if (regs ==NULL ) +return ; + +bust_spinlocks (1 ); +spin_lock (&show_regs_lock); +printk ("----------- IPI show regs -----------\n" ); +show_regs (regs); +spin_unlock (&show_regs_lock); +bust_spinlocks (0 ); +} +/* * Free current thread data structures etc.. */
arch/x86_64/kernel/smp.c renamed from arch/x86_64/kernel/smp.c.ve129 +79 -0
91 lines not on this page · raw message
arch/x86_64/kernel/traps.c renamed from arch/x86_64/kernel/traps.c.ve129 +1 -0
@@ -460,6 +460,7 @@ void __kprobes die_nmi(char *str, structshow_registers (regs);if (panic_on_timeout || panic_on_oops)panic ("nmi watchdog" ); +smp_nmi_call_function (smp_show_regs,NULL ,1 );printk ("console shuts up ...\n" );oops_end (flags);do_exit (SIGSEGV );
drivers/char/sysrq.c renamed from drivers/char/sysrq.c.ve129 +1 -1
@@ -178,7 +178,7 @@ static void sysrq_handle_showregs(int keif (pt_regs)show_regs (pt_regs);bust_spinlocks (0 ); -#ifdef __i386__ +#if defined(__i386__) || defined(__x86_64__)smp_nmi_call_function (smp_show_regs,NULL ,0 );#endif }
include/asm-x86_64/nmi.h renamed from include/asm-x86_64/nmi.h.ve129 +3 -0
@@ -24,6 +24,9 @@ void set_nmi_callback(nmi_callback_t cal* Remove the handler previously set. */ void unset_nmi_callback (void ); + +void set_nmi_ipi_callback (nmi_callback_t callback); +void unset_nmi_ipi_callback (void );#ifdef CONFIG_PM
Quoted 8 lines · Kirill Korotaev
[PATCH] IPI calltraces on
x86_64This patch makes
x86_64kernel to print calltraces on _all_ CPUs on Alt-SysRq-p and NMI LOCKUP.
This patch supplements the one made for i386
some time ago and included in -mm tree.
Since it proved its usefullness many times already we did the same patch forx86_64.
Sorry for the late answer.
I don't like the new call back. Can you change it to use the die notifier chain?
-Andi