perf/x86-ibs: Implement workaround for IBS erratum #420
authorRobert Richter <robert.richter@amd.com>
Mon, 2 Apr 2012 18:19:16 +0000 (20:19 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 9 May 2012 13:23:16 +0000 (15:23 +0200)
commitc9574fe0bdb9ac9a2698e02a712088ce8431e9f8
treeaaa5ad58269c78937ffac9ec3fc8ceffd4f55ff7
parent7caaf4d8241feecafb87919402b0a6dbb1b71d9e
perf/x86-ibs: Implement workaround for IBS erratum #420

When disabling ibs there might be the case where hardware continuously
generates interrupts. This is described in erratum #420 (Instruction-
Based Sampling Engine May Generate Interrupt that Cannot Be Cleared).
To avoid this we must clear the counter mask first and then clear the
enable bit. This patch implements this.

See Revision Guide for AMD Family 10h Processors, Publication #41322.

Note: We now keep track of the last read ibs config value which is
then used to disable ibs. To update the config value we pass now a
pointer to the functions reading it.

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-11-git-send-email-robert.richter@amd.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/cpu/perf_event_amd_ibs.c