[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20260128161245.3085391-1-ben.horgan@arm.com>
Date: Wed, 28 Jan 2026 16:12:45 +0000
From: Ben Horgan <ben.horgan@....com>
To: linux-kernel@...r.kernel.org
Cc: tony.luck@...el.com,
reinette.chatre@...el.com,
Dave.Martin@....com,
james.morse@....com,
babu.moger@....com,
bp@...en8.de,
Ben Horgan <ben.horgan@....com>
Subject: [PATCH v2] fs/resctrl: Add missing kconfig entry for CONFIG_RESCTRL_ASSIGN_FIXED
The commit 3b497c3f4f04 ("fs/resctrl: Introduce the interface to display
monitoring modes") introduced CONFIG_RESCTRL_ASSIGN_FIXED but left adding
the kconfig entry until it was necessary. Add the kconfig entry as it is
now necessary in order to support ABMC on MPAM where the counter assignment
mode is indeed fixed.
Also, take the opportunity ensure that a user attempt to change between
different counter assignment mode fails from the resctrl code rather than
delegating to the arch specific code and let the user know by adding a
message in last_cmd_status.
Signed-off-by: Ben Horgan <ben.horgan@....com>
---
Changes since v1:
Update the commit message to make it clear this is an anticipated follow on
patch rather than a fix.
Only fail attempts to change to a different counter assignment mode.
Kconfig indenting.
Use "counter assignment mode" text throughout.
---
fs/resctrl/Kconfig | 9 +++++++++
fs/resctrl/monitor.c | 6 ++++++
2 files changed, 15 insertions(+)
diff --git a/fs/resctrl/Kconfig b/fs/resctrl/Kconfig
index 21671301bd8a..d833dea81aea 100644
--- a/fs/resctrl/Kconfig
+++ b/fs/resctrl/Kconfig
@@ -37,3 +37,12 @@ config RESCTRL_RMID_DEPENDS_ON_CLOSID
Enabled by the architecture when the RMID values depend on the CLOSID.
This causes the CLOSID allocator to search for CLOSID with clean
RMID.
+
+config RESCTRL_ASSIGN_FIXED
+ bool
+ depends on RESCTRL_FS
+ help
+ Enabled by the architecture when the counter assignment mode is not
+ configurable. This ensures that counter assignment mode is not
+ advertised as configurable and attempts to change counter assignment
+ mode fail.
diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c
index 572a9925bd6c..93756be50062 100644
--- a/fs/resctrl/monitor.c
+++ b/fs/resctrl/monitor.c
@@ -1451,6 +1451,12 @@ ssize_t resctrl_mbm_assign_mode_write(struct kernfs_open_file *of, char *buf,
}
if (enable != resctrl_arch_mbm_cntr_assign_enabled(r)) {
+ if (IS_ENABLED(CONFIG_RESCTRL_ASSIGN_FIXED)) {
+ ret = -EINVAL;
+ rdt_last_cmd_puts("counter assignment mode is not configurable\n");
+ goto out_unlock;
+ }
+
ret = resctrl_arch_mbm_cntr_assign_set(r, enable);
if (ret)
goto out_unlock;
--
2.43.0
Powered by blists - more mailing lists