When all bits are shared between software and hardware, CAT test can not run.
In the case of MPAM driver, even if all bits are shared between hardware and software, they can be used as if software-exclusive. To enable CAT, if all bits are shared between hardware and software, set shareable_mask to zero. Signed-off-by: Shaopeng Tan <[email protected]> --- tools/testing/selftests/resctrl/resctrlfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/resctrl/resctrlfs.c b/tools/testing/selftests/resctrl/resctrlfs.c index 195f04c4d158..4b9ee803a112 100644 --- a/tools/testing/selftests/resctrl/resctrlfs.c +++ b/tools/testing/selftests/resctrl/resctrlfs.c @@ -495,6 +495,8 @@ int get_mask_no_shareable(const char *cache_type, unsigned long *mask) return -1; if (get_shareable_mask(cache_type, &shareable_mask) < 0) return -1; + if (full_mask == shareable_mask) + shareable_mask = 0; len = count_contiguous_bits(full_mask & ~shareable_mask, &start); if (!len) -- 2.47.3

