Commit 2d4daa54 authored by Babu Moger's avatar Babu Moger Committed by Borislav Petkov

x86/resctrl: Remove arch_has_empty_bitmaps

The field arch_has_empty_bitmaps is not required anymore. The field
min_cbm_bits is enough to validate the CBM (capacity bit mask) if the
architecture can support the zero CBM or not.
Suggested-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: default avatarBabu Moger <babu.moger@amd.com>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Reviewed-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Reviewed-by: default avatarFenghua Yu <fenghua.yu@intel.com>
Link: https://lore.kernel.org/r/166430979654.372014.615622285687642644.stgit@bmoger-ubuntu
parent 247f34f7
...@@ -828,7 +828,6 @@ static __init void rdt_init_res_defs_intel(void) ...@@ -828,7 +828,6 @@ static __init void rdt_init_res_defs_intel(void)
if (r->rid == RDT_RESOURCE_L3 || if (r->rid == RDT_RESOURCE_L3 ||
r->rid == RDT_RESOURCE_L2) { r->rid == RDT_RESOURCE_L2) {
r->cache.arch_has_sparse_bitmaps = false; r->cache.arch_has_sparse_bitmaps = false;
r->cache.arch_has_empty_bitmaps = false;
r->cache.arch_has_per_cpu_cfg = false; r->cache.arch_has_per_cpu_cfg = false;
r->cache.min_cbm_bits = 1; r->cache.min_cbm_bits = 1;
} else if (r->rid == RDT_RESOURCE_MBA) { } else if (r->rid == RDT_RESOURCE_MBA) {
...@@ -849,7 +848,6 @@ static __init void rdt_init_res_defs_amd(void) ...@@ -849,7 +848,6 @@ static __init void rdt_init_res_defs_amd(void)
if (r->rid == RDT_RESOURCE_L3 || if (r->rid == RDT_RESOURCE_L3 ||
r->rid == RDT_RESOURCE_L2) { r->rid == RDT_RESOURCE_L2) {
r->cache.arch_has_sparse_bitmaps = true; r->cache.arch_has_sparse_bitmaps = true;
r->cache.arch_has_empty_bitmaps = true;
r->cache.arch_has_per_cpu_cfg = true; r->cache.arch_has_per_cpu_cfg = true;
r->cache.min_cbm_bits = 0; r->cache.min_cbm_bits = 0;
} else if (r->rid == RDT_RESOURCE_MBA) { } else if (r->rid == RDT_RESOURCE_MBA) {
......
...@@ -105,8 +105,7 @@ static bool cbm_validate(char *buf, u32 *data, struct rdt_resource *r) ...@@ -105,8 +105,7 @@ static bool cbm_validate(char *buf, u32 *data, struct rdt_resource *r)
return false; return false;
} }
if ((!r->cache.arch_has_empty_bitmaps && val == 0) || if ((r->cache.min_cbm_bits > 0 && val == 0) || val > r->default_ctrl) {
val > r->default_ctrl) {
rdt_last_cmd_puts("Mask out of range\n"); rdt_last_cmd_puts("Mask out of range\n");
return false; return false;
} }
......
...@@ -89,11 +89,12 @@ struct rdt_domain { ...@@ -89,11 +89,12 @@ struct rdt_domain {
/** /**
* struct resctrl_cache - Cache allocation related data * struct resctrl_cache - Cache allocation related data
* @cbm_len: Length of the cache bit mask * @cbm_len: Length of the cache bit mask
* @min_cbm_bits: Minimum number of consecutive bits to be set * @min_cbm_bits: Minimum number of consecutive bits to be set.
* The value 0 means the architecture can support
* zero CBM.
* @shareable_bits: Bitmask of shareable resource with other * @shareable_bits: Bitmask of shareable resource with other
* executing entities * executing entities
* @arch_has_sparse_bitmaps: True if a bitmap like f00f is valid. * @arch_has_sparse_bitmaps: True if a bitmap like f00f is valid.
* @arch_has_empty_bitmaps: True if the '0' bitmap is valid.
* @arch_has_per_cpu_cfg: True if QOS_CFG register for this cache * @arch_has_per_cpu_cfg: True if QOS_CFG register for this cache
* level has CPU scope. * level has CPU scope.
*/ */
...@@ -102,7 +103,6 @@ struct resctrl_cache { ...@@ -102,7 +103,6 @@ struct resctrl_cache {
unsigned int min_cbm_bits; unsigned int min_cbm_bits;
unsigned int shareable_bits; unsigned int shareable_bits;
bool arch_has_sparse_bitmaps; bool arch_has_sparse_bitmaps;
bool arch_has_empty_bitmaps;
bool arch_has_per_cpu_cfg; bool arch_has_per_cpu_cfg;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment