Commit 3fb2b8dd authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

perf, x86, Do not user perf_disable from NMI context

Explicitly use intel_pmu_{disable,enable}_all() in intel_pmu_handle_irq()
to avoid the NMI race conditions in perf_{disable,enable}
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: paulus@samba.org
Cc: eranian@google.com
Cc: robert.richter@amd.com
Cc: fweisbec@gmail.com
LKML-Reference: <new-submission>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 32975a4f
...@@ -745,11 +745,11 @@ static int intel_pmu_handle_irq(struct pt_regs *regs) ...@@ -745,11 +745,11 @@ static int intel_pmu_handle_irq(struct pt_regs *regs)
cpuc = &__get_cpu_var(cpu_hw_events); cpuc = &__get_cpu_var(cpu_hw_events);
perf_disable(); intel_pmu_disable_all();
intel_pmu_drain_bts_buffer(); intel_pmu_drain_bts_buffer();
status = intel_pmu_get_status(); status = intel_pmu_get_status();
if (!status) { if (!status) {
perf_enable(); intel_pmu_enable_all();
return 0; return 0;
} }
...@@ -759,8 +759,7 @@ again: ...@@ -759,8 +759,7 @@ again:
WARN_ONCE(1, "perfevents: irq loop stuck!\n"); WARN_ONCE(1, "perfevents: irq loop stuck!\n");
perf_event_print_debug(); perf_event_print_debug();
intel_pmu_reset(); intel_pmu_reset();
perf_enable(); goto done;
return 1;
} }
inc_irq_stat(apic_perf_irqs); inc_irq_stat(apic_perf_irqs);
...@@ -790,8 +789,8 @@ again: ...@@ -790,8 +789,8 @@ again:
if (status) if (status)
goto again; goto again;
perf_enable(); done:
intel_pmu_enable_all();
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment