Skip to content

Commit 2d4daa5

Browse files
babumogersuryasaimadhu
authored andcommitted
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: Reinette Chatre <[email protected]> Signed-off-by: Babu Moger <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Reviewed-by: Fenghua Yu <[email protected]> Link: https://lore.kernel.org/r/166430979654.372014.615622285687642644.stgit@bmoger-ubuntu
1 parent 247f34f commit 2d4daa5

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

arch/x86/kernel/cpu/resctrl/core.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,6 @@ static __init void rdt_init_res_defs_intel(void)
828828
if (r->rid == RDT_RESOURCE_L3 ||
829829
r->rid == RDT_RESOURCE_L2) {
830830
r->cache.arch_has_sparse_bitmaps = false;
831-
r->cache.arch_has_empty_bitmaps = false;
832831
r->cache.arch_has_per_cpu_cfg = false;
833832
r->cache.min_cbm_bits = 1;
834833
} else if (r->rid == RDT_RESOURCE_MBA) {
@@ -849,7 +848,6 @@ static __init void rdt_init_res_defs_amd(void)
849848
if (r->rid == RDT_RESOURCE_L3 ||
850849
r->rid == RDT_RESOURCE_L2) {
851850
r->cache.arch_has_sparse_bitmaps = true;
852-
r->cache.arch_has_empty_bitmaps = true;
853851
r->cache.arch_has_per_cpu_cfg = true;
854852
r->cache.min_cbm_bits = 0;
855853
} else if (r->rid == RDT_RESOURCE_MBA) {

arch/x86/kernel/cpu/resctrl/ctrlmondata.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ static bool cbm_validate(char *buf, u32 *data, struct rdt_resource *r)
105105
return false;
106106
}
107107

108-
if ((!r->cache.arch_has_empty_bitmaps && val == 0) ||
109-
val > r->default_ctrl) {
108+
if ((r->cache.min_cbm_bits > 0 && val == 0) || val > r->default_ctrl) {
110109
rdt_last_cmd_puts("Mask out of range\n");
111110
return false;
112111
}

include/linux/resctrl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,12 @@ struct rdt_domain {
8989
/**
9090
* struct resctrl_cache - Cache allocation related data
9191
* @cbm_len: Length of the cache bit mask
92-
* @min_cbm_bits: Minimum number of consecutive bits to be set
92+
* @min_cbm_bits: Minimum number of consecutive bits to be set.
93+
* The value 0 means the architecture can support
94+
* zero CBM.
9395
* @shareable_bits: Bitmask of shareable resource with other
9496
* executing entities
9597
* @arch_has_sparse_bitmaps: True if a bitmap like f00f is valid.
96-
* @arch_has_empty_bitmaps: True if the '0' bitmap is valid.
9798
* @arch_has_per_cpu_cfg: True if QOS_CFG register for this cache
9899
* level has CPU scope.
99100
*/
@@ -102,7 +103,6 @@ struct resctrl_cache {
102103
unsigned int min_cbm_bits;
103104
unsigned int shareable_bits;
104105
bool arch_has_sparse_bitmaps;
105-
bool arch_has_empty_bitmaps;
106106
bool arch_has_per_cpu_cfg;
107107
};
108108

0 commit comments

Comments
 (0)