[PATCH v5 08/16] x86/resctrl: Expose assign_global_enable_per_cpu when PLZA is available

From: Babu Moger

Date: Wed Aug 26 2026 - 15:36:09 EST


Generic resctrl exposes kernel modes through sysfs only after architectures
register them with resctrl_set_kmode_support().

PLZA provides per-CPU kernel mode allocation and monitoring assignment, but
assign_global_enable_per_cpu is never registered during x86 initialization.

Register RESCTRL_ASSIGN_GLOBAL_ENABLE_PER_CPU when PLZA is available and
resctrl allocation or monitoring resources are present.

Signed-off-by: Babu Moger <babu.moger@xxxxxxx>
---
v5: Update the patch to adapt new data structure and resctrl_set_kmode_support()
changes.

v4: New patch to set the supported features during arch init.
---
arch/x86/kernel/cpu/resctrl/core.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
index 4ca8bedeb995..39d6a2a60805 100644
--- a/arch/x86/kernel/cpu/resctrl/core.c
+++ b/arch/x86/kernel/cpu/resctrl/core.c
@@ -1021,6 +1021,10 @@ static __init bool get_rdt_resources(void)
rdt_alloc_capable = get_rdt_alloc_resources();
rdt_mon_capable = get_rdt_mon_resources();

+ if (rdt_cpu_has(X86_FEATURE_PLZA) &&
+ (rdt_alloc_capable || rdt_mon_capable))
+ resctrl_set_kmode_support(RESCTRL_ASSIGN_GLOBAL_ENABLE_PER_CPU);
+
return (rdt_mon_capable || rdt_alloc_capable);
}

--
2.43.0