linux-yocto/arch/x86/events
Ravi Bangoria e7e61e09ce perf/amd/ibs: Fix perf_ibs_op.cnt_mask for CurCnt
[ Upstream commit 46dcf85566 ]

IBS Op uses two counters: MaxCnt and CurCnt. MaxCnt is programmed with
the desired sample period. IBS hw generates sample when CurCnt reaches
to MaxCnt. The size of these counter used to be 20 bits but later they
were extended to 27 bits. The 7 bit extension is indicated by CPUID
Fn8000_001B_EAX[6 / OpCntExt].

perf_ibs->cnt_mask variable contains bit masks for MaxCnt and CurCnt.
But IBS driver does not set upper 7 bits of CurCnt in cnt_mask even
when OpCntExt CPUID bit is set. Fix this.

IBS driver uses cnt_mask[CurCnt] bits only while disabling an event.
Fortunately, CurCnt bits are not read from MSR while re-enabling the
event, instead MaxCnt is programmed with desired period and CurCnt is
set to 0. Hence, we did not see any issues so far.

Signed-off-by: Ravi Bangoria <ravi.bangoria@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/r/20250115054438.1021-5-ravi.bangoria@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-06-04 14:40:17 +02:00
..
amd perf/amd/ibs: Fix perf_ibs_op.cnt_mask for CurCnt 2025-06-04 14:40:17 +02:00
intel perf/x86/intel: KVM: Mask PEBS_ENABLE loaded for guest with vCPU's value. 2025-05-09 09:41:34 +02:00
zhaoxin x86/perf/zhaoxin: Add stepping check for ZXC 2023-03-10 09:32:45 +01:00
core.c perf/x86: Fix non-sampling (counting) events on certain x86 platforms 2025-05-02 07:46:55 +02:00
Kconfig perf/x86/Kconfig: Fix indentation in the Kconfig file 2022-05-25 15:54:26 +02:00
Makefile perf/x86: Move branch classifier 2022-08-27 00:05:44 +02:00
msr.c perf/x86/msr: Add Emerald Rapids 2023-02-01 08:34:30 +01:00
perf_event_flags.h x86/perf: Assert all platform event flags are within PERF_EVENT_FLAG_ARCH 2022-09-07 21:54:01 +02:00
perf_event.h perf/x86/intel: Avoid disable PMU if !cpuc->enabled in sample read 2025-04-10 14:33:42 +02:00
probe.c perf/x86/rapl: Add msr mask support 2021-02-10 14:44:54 +01:00
probe.h perf/x86/rapl: Add msr mask support 2021-02-10 14:44:54 +01:00
rapl.c perf/x86/rapl: Add support for Intel Emerald Rapids 2023-01-24 07:24:32 +01:00
utils.c perf/x86/lbr: Filter vsyscall addresses 2023-10-19 23:08:56 +02:00