[tip: x86/cache] arm_mpam: resctrl: Add pass-through resctrl_arch_preconvert_bw()
From: tip-bot2 for Ben Horgan
Date: Mon Sep 14 2026 - 15:18:16 EST
The following commit has been merged into the x86/cache branch of tip:
Commit-ID: 255f92316ac1017478e9ace42cafdeb6c98c1f25
Gitweb: https://git.kernel.org/tip/255f92316ac1017478e9ace42cafdeb6c98c1f25
Author: Ben Horgan <ben.horgan@xxxxxxx>
AuthorDate: Fri, 11 Sep 2026 17:36:12 +01:00
Committer: Borislav Petkov (AMD) <bp@xxxxxxxxx>
CommitterDate: Mon, 14 Sep 2026 08:18:23 -07:00
arm_mpam: resctrl: Add pass-through resctrl_arch_preconvert_bw()
resctrl rounds up the percentage value of the MBA based on the bw_gran. As
MPAM uses a binary fixed point fraction format for MBA rather than a decimal
percentage, this introduces rounding errors.
Without this additional rounding, if the user reads the value in an MB schema
and then writes it back to the schema, the value in hardware won't change.
However, with this additional rounding, this guarantee is broken for systems
with mbw_wd < 7.
resctrl is introducing resctrl_arch_preconvert_bw() to allow the arch code
to specify the conversion resctrl does to the user-provided bandwidth
value. Add the MPAM version of resctrl_arch_preconvert_bw(). This does no
conversion.
Signed-off-by: Ben Horgan <ben.horgan@xxxxxxx>
Signed-off-by: Borislav Petkov (AMD) <bp@xxxxxxxxx>
Reviewed-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>
Reviewed-by: Gavin Shan <gshan@xxxxxxxxxx>
Link: https://patch.msgid.link/20260911163613.1131447-3-ben.horgan@xxxxxxx
---
drivers/resctrl/mpam_resctrl.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/resctrl/mpam_resctrl.c b/drivers/resctrl/mpam_resctrl.c
index 9d22305..f2c651e 100644
--- a/drivers/resctrl/mpam_resctrl.c
+++ b/drivers/resctrl/mpam_resctrl.c
@@ -148,6 +148,11 @@ bool resctrl_arch_get_cdp_enabled(enum resctrl_res_level rid)
return mpam_resctrl_controls[rid].cdp_enabled;
}
+u32 resctrl_arch_preconvert_bw(const struct rdt_resource *r, u32 val)
+{
+ return val;
+}
+
/**
* resctrl_reset_task_closids() - Reset the PARTID/PMG values for all tasks.
*