All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zide Chen <zide.chen@intel.com>
To: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Andi Kleen <ak@linux.intel.com>,
	Eranian Stephane <eranian@google.com>
Cc: Chun-Tse Shao <ctshao@google.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	Dapeng Mi <dapeng1.mi@linux.intel.com>,
	Zide Chen <zide.chen@intel.com>
Subject: [PATCH 12/12] perf/x86/intel/uncore: Fix DMR IMC threshold field
Date: Fri,  4 Dec 2026 20:22:53 -0700	[thread overview]
Message-ID: <20261205032253.258646-13-zide.chen@intel.com> (raw)
In-Reply-To: <20261205032253.258646-1-zide.chen@intel.com>

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@intel.com>
---
 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


  parent reply	other threads:[~2026-12-05  3:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05  3:22 [PATCH 00/12] perf/x86/intel/uncore: Fix 64-bit counter config Zide Chen
2026-12-05  3:22 ` [PATCH 01/12] perf/x86/intel/uncore: Fix PCU filter band mask calculation Zide Chen
2026-12-05  3:22 ` [PATCH 02/12] perf/x86/intel/uncore: Fix ICX UPI and M3UPI box control offset Zide Chen
2026-12-05  3:22 ` [PATCH 03/12] perf/x86/intel/uncore: Replace CTL_OFFS8 box flag with type flag Zide Chen
2026-12-05  3:22 ` [PATCH 04/12] perf/x86/intel/uncore: Fix DMR MMIO counter control stride Zide Chen
2026-12-05  3:22 ` [PATCH 05/12] perf/x86/intel/uncore: Drop spr_uncore_mmio_ops for generic MMIO Zide Chen
2026-12-05  3:22 ` [PATCH 06/12] perf/x86/intel/uncore: Fix SPR/EMR/GNR/SRF IMC and HBM event formats Zide Chen
2026-12-05  3:49   ` sashiko-bot
2026-12-05  4:41     ` Chen, Zide
2026-12-05  3:22 ` [PATCH 07/12] perf/x86/intel/uncore: Program upper dword in generic ops Zide Chen
2026-12-05  3:22 ` [PATCH 08/12] perf/x86/intel/uncore: Drop spr_uncore_pci_ops for generic PCI Zide Chen
2026-12-05  3:46   ` sashiko-bot
2026-12-05  4:41     ` Chen, Zide
2026-12-05  3:22 ` [PATCH 09/12] perf/x86/intel/uncore: Fix SKX/SNR/ICX PCI extended umask truncation Zide Chen
2026-12-05  3:22 ` [PATCH 10/12] perf/x86/intel/uncore: Program SNR PCIe3 upper filter before enable Zide Chen
2026-12-05  3:22 ` [PATCH 11/12] perf/x86/intel/uncore: Consolidate SKX, SNR and ICX PCI uncore ops Zide Chen
2026-12-05  3:53   ` sashiko-bot
2026-12-05  4:42     ` Chen, Zide
2026-12-05  3:22 ` Zide Chen [this message]
2026-12-05  3:54 ` [PATCH 00/12] perf/x86/intel/uncore: Fix 64-bit counter config sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261205032253.258646-13-zide.chen@intel.com \
    --to=zide.chen@intel.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=ctshao@google.com \
    --cc=dapeng1.mi@linux.intel.com \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.