Skip to content

Commit 802379b

Browse files
HojinNammwilldeacon
authored andcommitted
perf: CXL: fix CPMU filter value mask length
CPMU filter value is described as 4B length in CXL r3.0 8.2.7.2.2. However, it is used as 2B length in code and comments. Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Hojin Nam <hj96.nam@samsung.com> Link: https://lore.kernel.org/r/20240216014522.32321-1-hj96.nam@samsung.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent 2813926 commit 802379b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/perf/cxl_pmu.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
#define CXL_PMU_COUNTER_CFG_EVENT_GRP_ID_IDX_MSK GENMASK_ULL(63, 59)
6060

6161
#define CXL_PMU_FILTER_CFG_REG(n, f) (0x400 + 4 * ((f) + (n) * 8))
62-
#define CXL_PMU_FILTER_CFG_VALUE_MSK GENMASK(15, 0)
62+
#define CXL_PMU_FILTER_CFG_VALUE_MSK GENMASK(31, 0)
6363

6464
#define CXL_PMU_COUNTER_REG(n) (0xc00 + 8 * (n))
6565

@@ -314,9 +314,9 @@ static bool cxl_pmu_config1_get_edge(struct perf_event *event)
314314
}
315315

316316
/*
317-
* CPMU specification allows for 8 filters, each with a 16 bit value...
318-
* So we need to find 8x16bits to store it in.
319-
* As the value used for disable is 0xffff, a separate enable switch
317+
* CPMU specification allows for 8 filters, each with a 32 bit value...
318+
* So we need to find 8x32bits to store it in.
319+
* As the value used for disable is 0xffff_ffff, a separate enable switch
320320
* is needed.
321321
*/
322322

@@ -642,7 +642,7 @@ static void cxl_pmu_event_start(struct perf_event *event, int flags)
642642
if (cxl_pmu_config1_hdm_filter_en(event))
643643
cfg = cxl_pmu_config2_get_hdm_decoder(event);
644644
else
645-
cfg = GENMASK(15, 0); /* No filtering if 0xFFFF_FFFF */
645+
cfg = GENMASK(31, 0); /* No filtering if 0xFFFF_FFFF */
646646
writeq(cfg, base + CXL_PMU_FILTER_CFG_REG(hwc->idx, 0));
647647
}
648648

0 commit comments

Comments
 (0)