selftests/resctrl: Add CPU vendor detection for Hygon

The resctrl selftest currently fails on Hygon CPUs that support Platform
QoS features, printing the error:

  "# Can not get vendor info..."

This occurs because vendor detection is missing for Hygon CPUs.

Fix this by extending the CPU vendor detection logic to include
Hygon's vendor ID.

Link: https://lore.kernel.org/r/20251217030456.3834956-4-shenxiaochen@open-hieco.net
Signed-off-by: Xiaochen Shen <shenxiaochen@open-hieco.net>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:
Xiaochen Shen 2025-12-17 11:04:55 +08:00 committed by Shuah Khan
parent 4f4f01cc33
commit 367f931e64
2 changed files with 3 additions and 0 deletions

View File

@ -39,6 +39,7 @@
*/
#define ARCH_INTEL BIT(0)
#define ARCH_AMD BIT(1)
#define ARCH_HYGON BIT(2)
#define END_OF_TESTS 1

View File

@ -50,6 +50,8 @@ static unsigned int detect_vendor(void)
vendor_id = ARCH_INTEL;
else if (s && !strcmp(s, ": AuthenticAMD\n"))
vendor_id = ARCH_AMD;
else if (s && !strcmp(s, ": HygonGenuine\n"))
vendor_id = ARCH_HYGON;
fclose(inf);
free(res);