[RESEND PATCH v4 07/15] x86/resctrl: Expose the supported PLZA kernel-mode policies during init

From: Babu Moger

Date: Tue Jul 07 2026 - 17:54:11 EST


Generic resctrl exposes kernel-mode policy options via sysfs only after
architectures indicate the set of supported policies using
resctrl_set_kmode_support().

On AMD systems, Privilege Level Zero Association (PLZA) provides two
global assignment modes:

- GLOBAL_ASSIGN_CTRL_INHERIT_MON_PER_CPU: Assigns the resource allocation
for kernel work; but monitoring is inherited from the user task.
- GLOBAL_ASSIGN_CTRL_ASSIGN_MON_PER_CPU: Assigns a dedicated resource
allocation and monitoring for kernel work.

Expose these modes during resource discovery when PLZA is available.

Signed-off-by: Babu Moger <babu.moger@xxxxxxx>
---
v4: New patch to set the supported features during arch init.
---
arch/x86/kernel/cpu/resctrl/core.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
index 27e09cded829..df7e19fe6007 100644
--- a/arch/x86/kernel/cpu/resctrl/core.c
+++ b/arch/x86/kernel/cpu/resctrl/core.c
@@ -962,6 +962,9 @@ static __init bool get_rdt_alloc_resources(void)
if (get_slow_mem_config())
ret = true;

+ if (ret && rdt_cpu_has(X86_FEATURE_PLZA))
+ resctrl_set_kmode_support(GLOBAL_ASSIGN_CTRL_INHERIT_MON_PER_CPU);
+
return ret;
}

@@ -988,6 +991,9 @@ static __init bool get_rdt_mon_resources(void)
if (!ret)
return false;

+ if (rdt_cpu_has(X86_FEATURE_PLZA))
+ resctrl_set_kmode_support(GLOBAL_ASSIGN_CTRL_ASSIGN_MON_PER_CPU);
+
return !rdt_get_l3_mon_config(r);
}

--
2.43.0