From: Fernando Vazquez Date: Sun, 1 Oct 2006 06:29:10 +0000 (-0700) Subject: [PATCH] stack overflow safe kdump: safe smp_send_nmi_allbutself() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bc03613decef0cc4d2f3a24f19fa5a868745715f;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git [PATCH] stack overflow safe kdump: safe smp_send_nmi_allbutself() Re-implement smp_send_nmi_allbutself() so that calls to smp_processor_id (through send_IPI_allbutself) can be replaced with safe_smp_processor_id without affecting other parts of the kernel (as suggested by Eric Biederman). Signed-off-by: Fernando Vazquez Looks-reasonable-to: Andi Kleen Acked-by: "Eric W. Biederman" Cc: Vivek Goyal Cc: James Bottomley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/i386/kernel/crash.c b/arch/i386/kernel/crash.c index 2dfc049dafa3..144b43288965 100644 --- a/arch/i386/kernel/crash.c +++ b/arch/i386/kernel/crash.c @@ -134,7 +134,10 @@ static int crash_nmi_callback(struct notifier_block *self, static void smp_send_nmi_allbutself(void) { - send_IPI_allbutself(NMI_VECTOR); + cpumask_t mask = cpu_online_map; + cpu_clear(safe_smp_processor_id(), mask); + if (!cpus_empty(mask)) + send_IPI_mask(mask, NMI_VECTOR); } static struct notifier_block crash_nmi_nb = {