Linux Perf Users
 help / color / mirror / Atom feed
From: Davidlohr Bueso <dave@stgolabs.net>
To: jic23@kernel.org, will@kernel.org, mark.rutland@arm.com
Cc: harshal.t@samsung.com, icheng@nvidia.com,
	linux-cxl@vger.kernel.org, linux-perf-users@vger.kernel.org,
	Davidlohr Bueso <dave@stgolabs.net>
Subject: [PATCH v4 1/3] perf/cxlpmu: Fix 64-bit write to 32-bit HDM filter register
Date: Wed, 15 Jul 2026 12:14:52 -0700	[thread overview]
Message-ID: <20260715191454.459673-2-dave@stgolabs.net> (raw)
In-Reply-To: <20260715191454.459673-1-dave@stgolabs.net>

The HDM decoder filter configuration register is 32 bits wide, but the
driver programs it with a 64-bit writeq(). The filter value never
exceeds 32 bits, so the upper half of the write is always zero and
lands in the adjacent Filter ID 1 (Channel/Rank/Bank) configuration
register at offset+4.

Fixes: 5d7107c72796 ("perf: CXL Performance Monitoring Unit driver")
Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Reviewed-by: Richard Cheng <icheng@nvidia.com>
---
 drivers/perf/cxl_pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/perf/cxl_pmu.c b/drivers/perf/cxl_pmu.c
index 68a54d97d2a8..39b46550a510 100644
--- a/drivers/perf/cxl_pmu.c
+++ b/drivers/perf/cxl_pmu.c
@@ -635,7 +635,7 @@ static void cxl_pmu_event_start(struct perf_event *event, int flags)
 			cfg = cxl_pmu_config2_get_hdm_decoder(event);
 		else
 			cfg = GENMASK(31, 0); /* No filtering if 0xFFFF_FFFF */
-		writeq(cfg, base + CXL_PMU_FILTER_CFG_REG(hwc->idx, 0));
+		writel(cfg, base + CXL_PMU_FILTER_CFG_REG(hwc->idx, 0));
 	}
 
 	cfg = readq(base + CXL_PMU_COUNTER_CFG_REG(hwc->idx));
-- 
2.39.5


  reply	other threads:[~2026-07-15 19:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-15 19:14 [PATCH v4 0/3] perf/cxlpmu: Misc updates Davidlohr Bueso
2026-07-15 19:14 ` Davidlohr Bueso [this message]
2026-07-15 20:07   ` [PATCH v4 1/3] perf/cxlpmu: Fix 64-bit write to 32-bit HDM filter register sashiko-bot
2026-07-15 19:14 ` [PATCH v4 2/3] perf/cxlpmu: Add missing CXL 4.0 events Davidlohr Bueso
2026-07-15 19:14 ` [PATCH v4 3/3] perf/cxlpmu: Support Channel/Rank/Bank filter Davidlohr Bueso

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=20260715191454.459673-2-dave@stgolabs.net \
    --to=dave@stgolabs.net \
    --cc=harshal.t@samsung.com \
    --cc=icheng@nvidia.com \
    --cc=jic23@kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=will@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox