[PATCH v2 17/24] x86/resctrl: Use cdp_enabled in rdt_domain_reconfigure_cdp()

From: James Morse
Date: Fri Mar 12 2021 - 13:01:32 EST


rdt_domain_reconfigure_cdp() infers whether CDP is enabled by
checking the alloc_capable and alloc_enabled flags of the data
resources.

Now that we have an explicit cdp_enabled, use that.

Reviewed-by: Jamie Iles <jamie@xxxxxxxxxxxx>
Signed-off-by: James Morse <james.morse@xxxxxxx>
---
arch/x86/kernel/cpu/resctrl/rdtgroup.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
index 55c17adf763c..378cad0020da 100644
--- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
+++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
@@ -1933,14 +1933,16 @@ static int set_cache_qos_cfg(int level, bool enable)
/* Restore the qos cfg state when a domain comes online */
void rdt_domain_reconfigure_cdp(struct rdt_resource *r)
{
- if (!r->alloc_capable)
+ struct rdt_hw_resource *hw_res = resctrl_to_arch_res(r);
+
+ if (!hw_res->cdp_capable)
return;

if (r == &rdt_resources_all[RDT_RESOURCE_L2DATA].resctrl)
- l2_qos_cfg_update(&r->alloc_enabled);
+ l2_qos_cfg_update(&hw_res->cdp_enabled);

if (r == &rdt_resources_all[RDT_RESOURCE_L3DATA].resctrl)
- l3_qos_cfg_update(&r->alloc_enabled);
+ l3_qos_cfg_update(&hw_res->cdp_enabled);
}

/*
--
2.30.0