x86/resctrl: Allow different CODE/DATA configurations to be staged

Before the CDP resources can be merged, struct rdt_domain will need an
array of struct resctrl_staged_config, one per type of configuration.

Use the type as an index to the array to ensure that a schema
configuration string can't specify the same domain twice. This will
allow two schemata to apply configuration changes to one resource.

Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Jamie Iles <jamie@nuviainc.com>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Tested-by: Babu Moger <babu.moger@amd.com>
Link: https://lkml.kernel.org/r/20210728170637.25610-15-james.morse@arm.com
This commit is contained in:
James Morse
2021-07-28 17:06:27 +00:00
committed by Borislav Petkov
parent e8f7282552
commit 75408e4350
3 changed files with 20 additions and 9 deletions

View File

@@ -27,6 +27,8 @@ enum resctrl_conf_type {
CDP_DATA,
};
#define CDP_NUM_TYPES (CDP_DATA + 1)
/**
* struct resctrl_staged_config - parsed configuration to be applied
* @new_ctrl: new ctrl value to be loaded
@@ -64,7 +66,7 @@ struct rdt_domain {
int mbm_work_cpu;
int cqm_work_cpu;
struct pseudo_lock_region *plr;
struct resctrl_staged_config staged_config;
struct resctrl_staged_config staged_config[CDP_NUM_TYPES];
};
/**