aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorDon Zickus <dzickus@redhat.com>2011-01-04 22:38:07 -0500
committerIngo Molnar <mingo@elte.hu>2011-01-05 08:22:57 -0500
commit9ab181fa9ff73a38fccd0a4f1c40a38dfe62b535 (patch)
tree085c11333531b196be9eb8d5e088b169abe82067 /arch/x86/kernel
parentaef1b9cef78ae65c6501850851cc3f61f9be477b (diff)
x86: Only call smp_processor_id in non-preempt cases
There are some paths that walk the die_chain with preemption on. Make sure we are in an NMI call before we start doing anything. This was triggered by do_general_protection calling notify_die with DIE_GPF. Reported-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Don Zickus <dzickus@redhat.com> LKML-Reference: <1294198689-15447-1-git-send-email-dzickus@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/apic/hw_nmi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kernel/apic/hw_nmi.c b/arch/x86/kernel/apic/hw_nmi.c
index c57d0b599448..2b40a6045da2 100644
--- a/arch/x86/kernel/apic/hw_nmi.c
+++ b/arch/x86/kernel/apic/hw_nmi.c
@@ -51,7 +51,7 @@ arch_trigger_all_cpu_backtrace_handler(struct notifier_block *self,
51{ 51{
52 struct die_args *args = __args; 52 struct die_args *args = __args;
53 struct pt_regs *regs; 53 struct pt_regs *regs;
54 int cpu = smp_processor_id(); 54 int cpu;
55 55
56 switch (cmd) { 56 switch (cmd) {
57 case DIE_NMI: 57 case DIE_NMI:
@@ -63,6 +63,7 @@ arch_trigger_all_cpu_backtrace_handler(struct notifier_block *self,
63 } 63 }
64 64
65 regs = args->regs; 65 regs = args->regs;
66 cpu = smp_processor_id();
66 67
67 if (cpumask_test_cpu(cpu, to_cpumask(backtrace_mask))) { 68 if (cpumask_test_cpu(cpu, to_cpumask(backtrace_mask))) {
68 static arch_spinlock_t lock = __ARCH_SPIN_LOCK_UNLOCKED; 69 static arch_spinlock_t lock = __ARCH_SPIN_LOCK_UNLOCKED;