summaryrefslogtreecommitdiff
path: root/arch/x86/events/intel/knc.c
diff options
context:
space:
mode:
authorKan Liang <kan.liang@linux.intel.com>2024-06-26 07:35:34 -0700
committerPeter Zijlstra <peterz@infradead.org>2024-07-04 16:00:36 +0200
commit722e42e45c2f1c6d1adec7813651dba5139f52f4 (patch)
tree6110b0fd8d8877d8d9e9a9928ab5ff7d430e29a8 /arch/x86/events/intel/knc.c
parenta23eb2fc1d818cdac9b31f032842d55483a6a040 (diff)
downloadlwn-722e42e45c2f1c6d1adec7813651dba5139f52f4.tar.gz
lwn-722e42e45c2f1c6d1adec7813651dba5139f52f4.zip
perf/x86: Support counter mask
The current perf assumes that both GP and fixed counters are contiguous. But it's not guaranteed on newer Intel platforms or in a virtualization environment. Use the counter mask to replace the number of counters for both GP and the fixed counters. For the other ARCHs or old platforms which don't support a counter mask, using GENMASK_ULL(num_counter - 1, 0) to replace. There is no functional change for them. The interface to KVM is not changed. The number of counters still be passed to KVM. It can be updated later separately. Signed-off-by: Kan Liang <kan.liang@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Andi Kleen <ak@linux.intel.com> Reviewed-by: Ian Rogers <irogers@google.com> Link: https://lkml.kernel.org/r/20240626143545.480761-3-kan.liang@linux.intel.com
Diffstat (limited to 'arch/x86/events/intel/knc.c')
-rw-r--r--arch/x86/events/intel/knc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/events/intel/knc.c b/arch/x86/events/intel/knc.c
index 618001c208e8..034a1f6a457c 100644
--- a/arch/x86/events/intel/knc.c
+++ b/arch/x86/events/intel/knc.c
@@ -303,7 +303,7 @@ static const struct x86_pmu knc_pmu __initconst = {
.apic = 1,
.max_period = (1ULL << 39) - 1,
.version = 0,
- .num_counters = 2,
+ .cntr_mask64 = 0x3,
.cntval_bits = 40,
.cntval_mask = (1ULL << 40) - 1,
.get_event_constraints = x86_get_event_constraints,