1
0
Fork 0
alistair23-linux/arch/x86/events
Kim Phillips 47a4d54063 arch/x86/amd/ibs: Fix re-arming IBS Fetch
commit 221bfce5eb upstream.

Stephane Eranian found a bug in that IBS' current Fetch counter was not
being reset when the driver would write the new value to clear it along
with the enable bit set, and found that adding an MSR write that would
first disable IBS Fetch would make IBS Fetch reset its current count.

Indeed, the PPR for AMD Family 17h Model 31h B0 55803 Rev 0.54 - Sep 12,
2019 states "The periodic fetch counter is set to IbsFetchCnt [...] when
IbsFetchEn is changed from 0 to 1."

Explicitly set IbsFetchEn to 0 and then to 1 when re-enabling IBS Fetch,
so the driver properly resets the internal counter to 0 and IBS
Fetch starts counting again.

A family 15h machine tested does not have this problem, and the extra
wrmsr is also not needed on Family 19h, so only do the extra wrmsr on
families 16h through 18h.

Reported-by: Stephane Eranian <stephane.eranian@google.com>
Signed-off-by: Kim Phillips <kim.phillips@amd.com>
[peterz: optimized]
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://bugzilla.kernel.org/show_bug.cgi?id=206537
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-01 12:01:04 +01:00
..
amd arch/x86/amd/ibs: Fix re-arming IBS Fetch 2020-11-01 12:01:04 +01:00
intel perf/x86/intel/uncore: Reduce the number of CBOX counters 2020-10-29 09:57:30 +01:00
Kconfig perf/x86/rapl: Move RAPL support to common x86 code 2020-07-16 08:16:32 +02:00
Makefile perf/x86/rapl: Fix RAPL config variable bug 2020-07-16 08:16:32 +02:00
core.c perf/x86/intel: Fix PT PMI handling 2020-01-12 12:21:36 +01:00
msr.c perf/x86/msr: Add Tremont support 2020-03-05 16:43:38 +01:00
perf_event.h perf/x86/amd: Constrain Large Increment per Cycle events 2020-02-24 08:36:52 +01:00
probe.c perf/x86: Add MSR probe interface 2019-06-24 19:28:31 +02:00
probe.h perf/x86: Add MSR probe interface 2019-06-24 19:28:31 +02:00
rapl.c perf/x86/rapl: Fix missing psys sysfs attributes 2020-08-21 13:05:38 +02:00