linux_kselftest-fixes-6.10-rc7
This kselftest fixes update for Linux 6.10-rc7 consists of one single patch to fix the non-contiguous CBM resctrl: - AMD supports non-contiguous CBM but does not report it via CPUID. This test should not use CPUID on AMD to detect non-contiguous CBM support. Fix the problem so the test uses CPUID to discover non-contiguous CBM support only on Intel. -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEPZKym/RZuOCGeA/kCwJExA0NQxwFAmaEZZkACgkQCwJExA0N QxwgbRAAwLYXO30O83wEYW3CpTQ+zuEGB9OUwZpDX1zFatREYXUfwxWWnnZVHoed 4/ifd4Xn+GcHEDZi1adzAadEAbHWyta8nTzpNvP15wQ1zLCDq33G/ec+aFYiAntK zu/AGqwDvV+mgOq0OJ9QuZy/PSaB1WPcRXghxbaeiD0jJCZt8QL/WDjTuq7+n7J1 Sgbo0W9eoRpVNAgtAf8kFrghggvPAorrTvah28YMRM3yEGc5Vp3XtkURYAhbKBzr ZF/04PUoM2GDN3ua1wY63n3eGz5CupP7f/AdCRxwW0YJgKjGQuKmyBSt7AAdsAvy kV2eAy0Qb1u6JowJwfvJ/P5/nEgvtqovfMah/yLpr1Y0AIgycgKsmJcy6FaK1KlD hV3omXNLlRQGgepViHI7PEQcsYhi8GX3Mi9M8oWu5QgMCsxXocvpUVBu64gmUakK Foj3gI4CGPskgO5IT5FsZlv/PbyWNVntn+I7geSpemTxHy1e7CIxMGaDgSM3Wsps 3/IQvP4RwF0uHzvC5dK85JJe9toxD9zzXUZavyYUmrhSc6dfex0qvlynfhvvTL9S +sJe3gdu09PFZCMRFIsWmmeN6EopNEr6cLO46uLnkrHZVi33yhtezuTloXimo2yR udMYLsM2nVV5+S2m+0XGb+peXWu48bmxepNxHFfiIXDKWReaid0= =Net1 -----END PGP SIGNATURE----- Merge tag 'linux_kselftest-fixes-6.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull kselftest fixes from Shuah Khan: "One single patch to fix the non-contiguous CBM resctrl: - AMD supports non-contiguous CBM but does not report it via CPUID. This test should not use CPUID on AMD to detect non-contiguous CBM support. Fix the problem so the test uses CPUID to discover non-contiguous CBM support only on Intel" * tag 'linux_kselftest-fixes-6.10-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests/resctrl: Fix non-contiguous CBM for AMD
This commit is contained in:
commit
e9d22f7a66
@ -291,11 +291,30 @@ static int cat_run_test(const struct resctrl_test *test, const struct user_param
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool arch_supports_noncont_cat(const struct resctrl_test *test)
|
||||
{
|
||||
unsigned int eax, ebx, ecx, edx;
|
||||
|
||||
/* AMD always supports non-contiguous CBM. */
|
||||
if (get_vendor() == ARCH_AMD)
|
||||
return true;
|
||||
|
||||
/* Intel support for non-contiguous CBM needs to be discovered. */
|
||||
if (!strcmp(test->resource, "L3"))
|
||||
__cpuid_count(0x10, 1, eax, ebx, ecx, edx);
|
||||
else if (!strcmp(test->resource, "L2"))
|
||||
__cpuid_count(0x10, 2, eax, ebx, ecx, edx);
|
||||
else
|
||||
return false;
|
||||
|
||||
return ((ecx >> 3) & 1);
|
||||
}
|
||||
|
||||
static int noncont_cat_run_test(const struct resctrl_test *test,
|
||||
const struct user_params *uparams)
|
||||
{
|
||||
unsigned long full_cache_mask, cont_mask, noncont_mask;
|
||||
unsigned int eax, ebx, ecx, edx, sparse_masks;
|
||||
unsigned int sparse_masks;
|
||||
int bit_center, ret;
|
||||
char schemata[64];
|
||||
|
||||
@ -304,15 +323,8 @@ static int noncont_cat_run_test(const struct resctrl_test *test,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (!strcmp(test->resource, "L3"))
|
||||
__cpuid_count(0x10, 1, eax, ebx, ecx, edx);
|
||||
else if (!strcmp(test->resource, "L2"))
|
||||
__cpuid_count(0x10, 2, eax, ebx, ecx, edx);
|
||||
else
|
||||
return -EINVAL;
|
||||
|
||||
if (sparse_masks != ((ecx >> 3) & 1)) {
|
||||
ksft_print_msg("CPUID output doesn't match 'sparse_masks' file content!\n");
|
||||
if (arch_supports_noncont_cat(test) != sparse_masks) {
|
||||
ksft_print_msg("Hardware and kernel differ on non-contiguous CBM support!\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user