Thread (200 messages) 200 messages, 10 authors, 2025-09-10

Re: [PATCH 17/33] arm_mpam: Probe the hardware features resctrl supports

From: James Morse <james.morse@arm.com>
Date: 2025-09-09 16:57:27
Also in: linux-acpi, linux-devicetree, lkml

Hi Ben,

On 28/08/2025 14:44, Ben Horgan wrote:
On 8/22/25 16:29, James Morse wrote:
quoted
Expand the probing support with the control and monitor types
we can use with resctrl.
quoted
diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c
index 012e09e80300..290a04f8654f 100644
--- a/drivers/resctrl/mpam_devices.c
+++ b/drivers/resctrl/mpam_devices.c
@@ -102,7 +102,7 @@ static LLIST_HEAD(mpam_garbage);
 
 static u32 __mpam_read_reg(struct mpam_msc *msc, u16 reg)
 {
-	WARN_ON_ONCE(reg > msc->mapped_hwpage_sz);
+	WARN_ON_ONCE(reg + sizeof(u32) > msc->mapped_hwpage_sz);
Update in the patch that introduced this line.
Yeah - this got ripped out.
Now that the size is in the ACPI table, I should never need to debug it being wrong!
(and the resulting translation fault will be enough to say something is wrong)

quoted
diff --git a/drivers/resctrl/mpam_internal.h b/drivers/resctrl/mpam_internal.h
index c6f087f9fa7d..9f6cd4a68cce 100644
--- a/drivers/resctrl/mpam_internal.h
+++ b/drivers/resctrl/mpam_internal.h
@@ -136,6 +136,56 @@ static inline void mpam_mon_sel_lock_held(struct mpam_msc *msc)
quoted
+/* Bits for mpam_features_t */
+enum mpam_device_features {
+	mpam_feat_ccap_part = 0,
+	mpam_feat_cpor_part,
+	mpam_feat_mbw_part,
+	mpam_feat_mbw_min,
+	mpam_feat_mbw_max,
+	mpam_feat_mbw_prop,
+	mpam_feat_msmon,
+	mpam_feat_msmon_csu,
+	mpam_feat_msmon_csu_capture,
+	mpam_feat_msmon_csu_hw_nrdy,
+	mpam_feat_msmon_mbwu,
+	mpam_feat_msmon_mbwu_capture,
+	mpam_feat_msmon_mbwu_rwbw,
+	mpam_feat_msmon_mbwu_hw_nrdy,
+	mpam_feat_msmon_capt,
+	MPAM_FEATURE_LAST,
This isn't all the features or just the features supported by resctrl.
Just add them all in this patch?
I'm having trouble parsing this ...

I needed somewhere to split the features up, as there are rather a lot. Those that resctrl
supports seemed like the logical spot.

quoted
+};
+static_assert(BITS_PER_TYPE(mpam_features_t) >= MPAM_FEATURE_LAST);
+#define MPAM_ALL_FEATURES      ((1 << MPAM_FEATURE_LAST) - 1)
Unused?
Fixed, thanks!


Thanks,

James
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help