perf/x86/amd/ibs: Support 27-bit extended Op/cycle counter
authorKim Phillips <kim.phillips@amd.com>
Tue, 8 Sep 2020 21:47:39 +0000 (16:47 -0500)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 10 Sep 2020 09:19:36 +0000 (11:19 +0200)
commit8b0bed7d410f48499d72af2e2bcd890daad94e0d
treefe71f8689e38691caba515131ba4f43ed28a9372
parent36e1be8ada994d509538b3b1d0af8b63c351e729
perf/x86/amd/ibs: Support 27-bit extended Op/cycle counter

IBS hardware with the OpCntExt feature gets a 7-bit wider internal
counter.  Both the maximum and current count bitfields in the
IBS_OP_CTL register are extended to support reading and writing it.

No changes are necessary to the driver for handling the extra
contiguous current count bits (IbsOpCurCnt), as the driver already
passes through 32 bits of that field.  However, the driver has to do
some extra bit manipulation when converting from a period to the
non-contiguous (although conveniently aligned) extra bits in the
IbsOpMaxCnt bitfield.

This decreases IBS Op interrupt overhead when the period is over
1,048,560 (0xffff0), which would previously activate the driver's
software counter.  That threshold is now 134,217,712 (0x7fffff0).

Signed-off-by: Kim Phillips <kim.phillips@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200908214740.18097-7-kim.phillips@amd.com
arch/x86/events/amd/ibs.c
arch/x86/include/asm/perf_event.h