perf/x86-ibs: Catch spurious interrupts after stopping IBS
authorRobert Richter <robert.richter@amd.com>
Mon, 2 Apr 2012 18:19:17 +0000 (20:19 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 9 May 2012 13:23:16 +0000 (15:23 +0200)
After disabling IBS there could be still incomming NMIs with samples
that even have the valid bit cleared. Mark all this NMIs as handled to
avoid spurious interrupt messages.

Signed-off-by: Robert Richter <robert.richter@amd.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1333390758-10893-12-git-send-email-robert.richter@amd.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/cpu/perf_event_amd_ibs.c

index b14e71127c82bafe94f67291f222a59c4b497995..5a9f95b5cc2639bf3169090ffc9f141ac0f27136 100644 (file)
@@ -473,11 +473,13 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs)
        u64 *buf, *config, period;
 
        if (!test_bit(IBS_STARTED, pcpu->state)) {
-               /* Catch spurious interrupts after stopping IBS: */
-               if (!test_and_clear_bit(IBS_STOPPING, pcpu->state))
-                       return 0;
-               rdmsrl(perf_ibs->msr, *ibs_data.regs);
-               return (*ibs_data.regs & perf_ibs->valid_mask) ? 1 : 0;
+               /*
+                * Catch spurious interrupts after stopping IBS: After
+                * disabling IBS there could be still incomming NMIs
+                * with samples that even have the valid bit cleared.
+                * Mark all this NMIs as handled.
+                */
+               return test_and_clear_bit(IBS_STOPPING, pcpu->state) ? 1 : 0;
        }
 
        msr = hwc->config_base;