Commit c091e90
x86/resctrl: Add a helper to read/set the CDP configuration
Whether CDP is enabled for a hardware resource like the L3 cache can be
found by inspecting the alloc_enabled flags of the L3CODE/L3DATA struct
rdt_hw_resources, even if they aren't in use.
Once these resources are merged, the flags can't be compared. Whether
CDP is enabled needs tracking explicitly. If another architecture is
emulating CDP the behaviour may not be per-resource. 'cdp_capable' needs
to be visible to resctrl, even if its not in use, as this affects the
padding of the schemata table visible to user-space.
Add cdp_enabled to struct rdt_hw_resource and cdp_capable to struct
rdt_resource. Add resctrl_arch_set_cdp_enabled() to let resctrl enable
or disable CDP on a resource. resctrl_arch_get_cdp_enabled() lets it
read the current state.
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-12-james.morse@arm.com1 parent 32150ed commit c091e90
File tree
5 files changed
+62
-35
lines changed- arch/x86/kernel/cpu/resctrl
- include/linux
5 files changed
+62
-35
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
377 | 381 | | |
378 | 382 | | |
379 | 383 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
| 383 | + | |
383 | 384 | | |
384 | 385 | | |
385 | 386 | | |
| |||
394 | 395 | | |
395 | 396 | | |
396 | 397 | | |
| 398 | + | |
397 | 399 | | |
398 | 400 | | |
399 | 401 | | |
| |||
414 | 416 | | |
415 | 417 | | |
416 | 418 | | |
417 | | - | |
| 419 | + | |
418 | 420 | | |
419 | 421 | | |
420 | 422 | | |
| |||
435 | 437 | | |
436 | 438 | | |
437 | 439 | | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
438 | 447 | | |
439 | 448 | | |
440 | 449 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
688 | 688 | | |
689 | 689 | | |
690 | 690 | | |
691 | | - | |
692 | | - | |
| 691 | + | |
| 692 | + | |
693 | 693 | | |
694 | 694 | | |
695 | 695 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1940 | 1940 | | |
1941 | 1941 | | |
1942 | 1942 | | |
1943 | | - | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
1944 | 1946 | | |
1945 | 1947 | | |
1946 | 1948 | | |
1947 | | - | |
| 1949 | + | |
1948 | 1950 | | |
1949 | 1951 | | |
1950 | | - | |
| 1952 | + | |
1951 | 1953 | | |
1952 | 1954 | | |
1953 | 1955 | | |
| |||
1991 | 1993 | | |
1992 | 1994 | | |
1993 | 1995 | | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
1994 | 1999 | | |
1995 | 2000 | | |
1996 | 2001 | | |
1997 | 2002 | | |
1998 | | - | |
1999 | | - | |
2000 | | - | |
2001 | | - | |
2002 | | - | |
2003 | | - | |
2004 | | - | |
2005 | | - | |
2006 | | - | |
2007 | | - | |
2008 | | - | |
2009 | | - | |
2010 | 2003 | | |
2011 | 2004 | | |
2012 | | - | |
| 2005 | + | |
| 2006 | + | |
2013 | 2007 | | |
2014 | 2008 | | |
2015 | 2009 | | |
2016 | | - | |
| 2010 | + | |
2017 | 2011 | | |
2018 | 2012 | | |
2019 | 2013 | | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
2020 | 2017 | | |
2021 | 2018 | | |
2022 | 2019 | | |
2023 | | - | |
| 2020 | + | |
2024 | 2021 | | |
2025 | | - | |
2026 | | - | |
| 2022 | + | |
| 2023 | + | |
2027 | 2024 | | |
2028 | | - | |
2029 | | - | |
2030 | | - | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
2031 | 2044 | | |
2032 | 2045 | | |
2033 | 2046 | | |
2034 | 2047 | | |
2035 | | - | |
2036 | | - | |
2037 | | - | |
2038 | | - | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
2039 | 2052 | | |
2040 | 2053 | | |
2041 | 2054 | | |
| |||
2113 | 2126 | | |
2114 | 2127 | | |
2115 | 2128 | | |
2116 | | - | |
| 2129 | + | |
2117 | 2130 | | |
2118 | 2131 | | |
2119 | | - | |
| 2132 | + | |
2120 | 2133 | | |
2121 | 2134 | | |
2122 | 2135 | | |
| |||
3199 | 3212 | | |
3200 | 3213 | | |
3201 | 3214 | | |
3202 | | - | |
| 3215 | + | |
3203 | 3216 | | |
3204 | 3217 | | |
3205 | | - | |
| 3218 | + | |
3206 | 3219 | | |
3207 | 3220 | | |
3208 | 3221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| |||
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
166 | | - | |
| 167 | + | |
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
| |||
0 commit comments