[RFC PATCH 09/19] x86/resctrl: Add plza_capable in rdt_resource data structure
From: Babu Moger <babu.moger@amd.com>
Date: 2026-01-21 21:14:30
Also in:
kvm, lkml
Subsystem:
rdt - resource allocation, the rest, x86 architecture (32-bit and 64-bit) · Maintainers:
Tony Luck, Reinette Chatre, Linus Torvalds, Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen
Add plza_capable field to the rdt_resource structure to indicate whether Privilege Level Zero Association (PLZA) is supported for that resource type. Signed-off-by: Babu Moger <babu.moger@amd.com> --- arch/x86/kernel/cpu/resctrl/core.c | 6 ++++++ arch/x86/kernel/cpu/resctrl/rdtgroup.c | 5 +++++ include/linux/resctrl.h | 3 +++ 3 files changed, 14 insertions(+)
diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
index 2de3140dd6d1..e41fe5fa3f30 100644
--- a/arch/x86/kernel/cpu/resctrl/core.c
+++ b/arch/x86/kernel/cpu/resctrl/core.c@@ -295,6 +295,9 @@ static __init bool __rdt_get_mem_config_amd(struct rdt_resource *r) r->alloc_capable = true; + if (rdt_cpu_has(X86_FEATURE_PLZA)) + r->plza_capable = true; + return true; }
@@ -314,6 +317,9 @@ static void rdt_get_cache_alloc_cfg(int idx, struct rdt_resource *r) if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) r->cache.arch_has_sparse_bitmasks = ecx.split.noncont; r->alloc_capable = true; + + if (rdt_cpu_has(X86_FEATURE_PLZA)) + r->plza_capable = true; } static void rdt_get_cdp_config(int level)
diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
index 885026468440..540e1e719d7f 100644
--- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
+++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c@@ -229,6 +229,11 @@ bool resctrl_arch_get_cdp_enabled(enum resctrl_res_level l) return rdt_resources_all[l].cdp_enabled; } +bool resctrl_arch_get_plza_capable(enum resctrl_res_level l) +{ + return rdt_resources_all[l].r_resctrl.plza_capable; +} + void resctrl_arch_reset_all_ctrls(struct rdt_resource *r) { struct rdt_hw_resource *hw_res = resctrl_to_arch_res(r);
diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h
index 63d74c0dbb8f..ae252a0e6d92 100644
--- a/include/linux/resctrl.h
+++ b/include/linux/resctrl.h@@ -319,6 +319,7 @@ struct resctrl_mon { * @name: Name to use in "schemata" file. * @schema_fmt: Which format string and parser is used for this schema. * @cdp_capable: Is the CDP feature available on this resource + * @plza_capable: Is Privilege Level Zero Association capable? */ struct rdt_resource { int rid;
@@ -334,6 +335,7 @@ struct rdt_resource { char *name; enum resctrl_schema_fmt schema_fmt; bool cdp_capable; + bool plza_capable; }; /*
@@ -481,6 +483,7 @@ static inline u32 resctrl_get_config_index(u32 closid, bool resctrl_arch_get_cdp_enabled(enum resctrl_res_level l); int resctrl_arch_set_cdp_enabled(enum resctrl_res_level l, bool enable); +bool resctrl_arch_get_plza_capable(enum resctrl_res_level l); /** * resctrl_arch_mbm_cntr_assign_enabled() - Check if MBM counter assignment
--
2.34.1