Skip to content

Commit

Permalink
perf/x86-ibs: Catch spurious interrupts after stopping IBS
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Robert Richter authored and Ingo Molnar committed May 9, 2012
1 parent c9574fe commit fc5fb2b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions arch/x86/kernel/cpu/perf_event_amd_ibs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fc5fb2b

Please sign in to comment.