Re: [PATCH] x86, UV: Fix NMI handler for UV platforms

From: Ingo Molnar
Date: Mon Mar 21 2011 - 12:14:47 EST



* Jack Steiner <steiner@xxxxxxx> wrote:

> This fixes a problem seen on UV systems handling NMIs from the node controller.
> The original code used the DIE notifier as the hook to get to the UV NMI
> handler. This does not work if performance counters are active - the hw_perf
> code consumes the NMI and the UV handler is not called.

Sigh:

> --- linux.orig/arch/x86/kernel/traps.c 2011-03-21 09:05:43.000000000 -0500
> +++ linux/arch/x86/kernel/traps.c 2011-03-21 09:13:01.306555675 -0500
> @@ -57,6 +57,7 @@
> #include <asm/mce.h>
>
> #include <asm/mach_traps.h>
> +#include <asm/uv/uv.h>
>
> #ifdef CONFIG_X86_64
> #include <asm/x86_init.h>
> @@ -397,13 +398,16 @@ unknown_nmi_error(unsigned char reason,
> static notrace __kprobes void default_do_nmi(struct pt_regs *regs)
> {
> unsigned char reason = 0;
> + int handled;
>
> /*
> * CPU-specific NMI must be processed before non-CPU-specific
> * NMI, otherwise we may lose it, because the CPU-specific
> * NMI can not be detected/processed on other CPUs.
> */
> - if (notify_die(DIE_NMI, "nmi", regs, 0, 2, SIGINT) == NOTIFY_STOP)
> + handled = uv_handle_nmi(regs, reason);
> + if (notify_die(DIE_NMI, "nmi", regs, 0, 2, SIGINT) == NOTIFY_STOP ||
> + handled)
> return;

Such code is extremely ugly. Please *reduce* the number of is_uv_system() type
of hacks in core x86 code, not increase it!

Any reason why a higher priority for the UV NMI handler cannot solve the 'perf
eats the NMI' problem?

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/