From: Mike Travis <travis@sgi.com>
Subject: UV: Use show_regs in NMI handling
References: bnc#744655
Patch-mainline: Submitted 2 Fev 2012

Change to use the show_regs function as it displays more info per CPU.

Include attempt to set console level higher to actually see the messages
on the console instead of just the kernel log, but something is wrong
and it doesn't work.  So one of the following is needed before sending
the "power nmi" command:

shell:
	echo 6 > /proc/sysrq-trigger
kdb:
	sr 6

Signed-off-by: Mike Travis <travis@sgi.com>
Acked-by: Jeff Mahoney <jeffm@suse.com>
---
 arch/x86/kernel/apic/x2apic_uv_x.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

--- linux.orig/arch/x86/kernel/apic/x2apic_uv_x.c
+++ linux/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -684,6 +684,7 @@ int uv_handle_nmi(struct notifier_block
  	static int controlling_cpu = -1;
 	unsigned long real_uv_nmi;
 	int bid, handled = 0;
+	int saved_console_loglevel;
 
 	if (reason != DIE_NMIUNKNOWN && reason != DIE_NMI)
 		return NOTIFY_OK;
@@ -741,8 +742,12 @@ int uv_handle_nmi(struct notifier_block
 	 * This prevents intermixed output.
 	 */
 	spin_lock(&uv_nmi_lock);
-	pr_info("UV NMI stack dump cpu %u:\n", smp_processor_id());
-	dump_stack();
+	pr_err("== UV NMI process trace cpu %u: ==\n", smp_processor_id());
+	regs = args->regs;
+	saved_console_loglevel = console_loglevel;
+	console_loglevel = 6;
+	show_regs(regs);
+	console_loglevel = saved_console_loglevel;
 	spin_unlock(&uv_nmi_lock);
 
 	return NOTIFY_STOP;

