[PATCH 06/12] perf/x86/intel/uncore: Fix SPR/EMR/GNR/SRF IMC and HBM event formats
From: Zide Chen
Date: Fri Dec 04 2026 - 22:34:49 EST
IMC on SPR/EMR/GNR/SRF and HBM on SPR have only 32-bit counter control
registers with an 8-bit umask. However, their types inherited
SPR_UNCORE_COMMON_FORMAT(), erroneously setting event_mask_ext and
exposing non-existent extended umask bits 32-55 in sysfs.
Redefine SPR_UNCORE_MMIO_COMMON_FORMAT() using skx_uncore_format_group
without event_mask_ext, and switch spr_uncore_hbm to use it. This
narrows the sysfs umask attribute from "config:8-15,32-55" to
"config:8-15" to match hardware specs.
Fixes: 85f2e30f987e ("perf/x86/intel/uncore: Add Sapphire Rapids server IMC support")
Fixes: f8a86a9bb5f7 ("perf/x86/intel/uncore: Support HBM and CXL PMON counters")
Signed-off-by: Zide Chen <zide.chen@xxxxxxxxx>
---
arch/x86/events/intel/uncore_snbep.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index 9e164beb32c5..14232ef4f77b 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -5926,8 +5926,11 @@ static struct uncore_event_desc spr_uncore_imc_events[] = {
{ /* end: all zeroes */ },
};
+/* 32-bit MMIO counter control registers (4-byte stride, no upper dword) */
#define SPR_UNCORE_MMIO_COMMON_FORMAT() \
- SPR_UNCORE_COMMON_FORMAT()
+ .event_mask = SNBEP_PMON_RAW_EVENT_MASK, \
+ .format_group = &skx_uncore_format_group, \
+ .attr_update = uncore_alias_groups
static struct intel_uncore_type spr_uncore_imc = {
SPR_UNCORE_MMIO_COMMON_FORMAT(),
@@ -6024,7 +6027,7 @@ static struct intel_uncore_type spr_uncore_cxldp = {
};
static struct intel_uncore_type spr_uncore_hbm = {
- SPR_UNCORE_COMMON_FORMAT(),
+ SPR_UNCORE_MMIO_COMMON_FORMAT(),
.name = "hbm",
};
--
2.56.1