]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests/resctrl: Fix non-contiguous CBM check for Hygon
authorXiaochen Shen <shenxiaochen@open-hieco.net>
Wed, 17 Dec 2025 03:04:56 +0000 (11:04 +0800)
committerShuah Khan <skhan@linuxfoundation.org>
Fri, 9 Jan 2026 23:49:01 +0000 (16:49 -0700)
The resctrl selftest currently fails on Hygon CPUs that always supports
non-contiguous CBM, printing the error:

  "# Hardware and kernel differ on non-contiguous CBM support!"

This occurs because the arch_supports_noncont_cat() function lacks
vendor detection for Hygon CPUs, preventing proper identification of
their non-contiguous CBM capability.

Fix this by adding Hygon vendor ID detection to
arch_supports_noncont_cat().

Link: https://lore.kernel.org/r/20251217030456.3834956-5-shenxiaochen@open-hieco.net
Signed-off-by: Xiaochen Shen <shenxiaochen@open-hieco.net>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Reviewed-by: Fenghua Yu <fenghuay@nvidia.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/resctrl/cat_test.c

index 94cfdba5308d8c874054a91c792c2657e52f0973..f00b622c146082ca08ae3f3c3d5b76f1c29c8b5c 100644 (file)
@@ -290,8 +290,10 @@ static int cat_run_test(const struct resctrl_test *test, const struct user_param
 
 static bool arch_supports_noncont_cat(const struct resctrl_test *test)
 {
-       /* AMD always supports non-contiguous CBM. */
-       if (get_vendor() == ARCH_AMD)
+       unsigned int vendor_id = get_vendor();
+
+       /* AMD and Hygon always support non-contiguous CBM. */
+       if (vendor_id == ARCH_AMD || vendor_id == ARCH_HYGON)
                return true;
 
 #if defined(__i386__) || defined(__x86_64__) /* arch */