[PATCH 12/12] perf/x86/intel/uncore: Fix DMR IMC threshold field

From: Zide Chen

Date: Fri Dec 04 2026 - 22:35:06 EST


The DMR IMC threshold format (RES_THRESHOLD, EDS 23.3.51) should be
a 9-bit field spanning bits 24-32. Currently it is defined as thresh10,
erroneously overlapping bit 23 (inv).

Fix this by defining thresh9_3 (config:24-32) and setting
event_mask_ext so that bit 32 is not masked off by perf.

This is a user-visible change to the sysfs format ABI: the "thresh"
attribute changes from "config:23-32" to "config:24-32".

Fixes: 6daf2c35b835 ("perf/x86/intel/uncore: Add IMH PMON support for Diamond Rapids")
Signed-off-by: Zide Chen <zide.chen@xxxxxxxxx>
---
arch/x86/events/intel/uncore_snbep.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index 4e93b185790e..a3352d8dd752 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -480,6 +480,7 @@
#define DMR_CXLCM_EVENT_MASK_EXT 0xf
#define DMR_HAMVF_EVENT_MASK_EXT 0xffffffff
#define DMR_PCIE4_EVENT_MASK_EXT 0xffffff
+#define DMR_IMC_EVENT_MASK_EXT 0x1

#define UNCORE_DMR_ITC 0x30

@@ -503,7 +504,7 @@ DEFINE_UNCORE_FORMAT_ATTR(tid_en2, tid_en, "config:16");
DEFINE_UNCORE_FORMAT_ATTR(inv, inv, "config:23");
DEFINE_UNCORE_FORMAT_ATTR(inv2, inv, "config:21");
DEFINE_UNCORE_FORMAT_ATTR(thresh_ext, thresh_ext, "config:32-35");
-DEFINE_UNCORE_FORMAT_ATTR(thresh10, thresh, "config:23-32");
+DEFINE_UNCORE_FORMAT_ATTR(thresh9_3, thresh, "config:24-32");
DEFINE_UNCORE_FORMAT_ATTR(thresh9_2, thresh, "config:23-31");
DEFINE_UNCORE_FORMAT_ATTR(thresh9, thresh, "config:24-35");
DEFINE_UNCORE_FORMAT_ATTR(thresh8, thresh, "config:24-31");
@@ -6511,7 +6512,7 @@ static struct attribute *dmr_imc_uncore_formats_attr[] = {
&format_attr_umask.attr,
&format_attr_edge.attr,
&format_attr_inv.attr,
- &format_attr_thresh10.attr,
+ &format_attr_thresh9_3.attr,
NULL,
};

@@ -6525,6 +6526,7 @@ static struct intel_uncore_type dmr_uncore_imc = {
.fixed_ctr_bits = 48,
.fixed_ctr = DMR_IMC_PMON_FIXED_CTR,
.fixed_ctl = DMR_IMC_PMON_FIXED_CTL,
+ .event_mask_ext = DMR_IMC_EVENT_MASK_EXT,
.format_group = &dmr_imc_uncore_format_group,
.attr_update = uncore_alias_groups,
};
--
2.56.1