[PATCH v3 2/4] selftests/resctrl: Add CPU vendor detection for Hygon

Xiaochen Shen posted 4 patches 5 days, 5 hours ago
There is a newer version of this series
[PATCH v3 2/4] selftests/resctrl: Add CPU vendor detection for Hygon
Posted by Xiaochen Shen 5 days, 5 hours ago
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.

Signed-off-by: Xiaochen Shen <shenxiaochen@open-hieco.net>
---
 tools/testing/selftests/resctrl/resctrl.h       | 1 +
 tools/testing/selftests/resctrl/resctrl_tests.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h
index d0f094360e6f..2817c9e41797 100644
--- a/tools/testing/selftests/resctrl/resctrl.h
+++ b/tools/testing/selftests/resctrl/resctrl.h
@@ -39,6 +39,7 @@
  */
 #define ARCH_INTEL	BIT(0)
 #define ARCH_AMD	BIT(1)
+#define ARCH_HYGON	BIT(2)
 
 #define END_OF_TESTS	1
 
diff --git a/tools/testing/selftests/resctrl/resctrl_tests.c b/tools/testing/selftests/resctrl/resctrl_tests.c
index 08cbd094e936..92cc6aaef338 100644
--- a/tools/testing/selftests/resctrl/resctrl_tests.c
+++ b/tools/testing/selftests/resctrl/resctrl_tests.c
@@ -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);
-- 
2.47.3
Re: [PATCH v3 2/4] selftests/resctrl: Add CPU vendor detection for Hygon
Posted by Reinette Chatre 4 days, 6 hours ago
Hi Xiaochen,

On 12/10/25 10:46 PM, Xiaochen Shen wrote:
> 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.
> 
> Signed-off-by: Xiaochen Shen <shenxiaochen@open-hieco.net>
> ---

Changelog is clear this is a fix, does patch need backport?

Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>

Reinette
Re: [PATCH v3 2/4] selftests/resctrl: Add CPU vendor detection for Hygon
Posted by Xiaochen Shen 4 days, 4 hours ago
Hi Reinette,

On 12/12/2025 1:23 PM, Reinette Chatre wrote:
> Hi Xiaochen,
> 
> On 12/10/25 10:46 PM, Xiaochen Shen wrote:
>> 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.
>>
>> Signed-off-by: Xiaochen Shen <shenxiaochen@open-hieco.net>
>> ---
> 
> Changelog is clear this is a fix, does patch need backport?

Thank you for pointing out this issue.
This patch is not a candidate for backport. I will add a maintainer note:
---------------------------
Maintainer note:
Even though this is a fix it is not a candidate for backport since it is
based on another patch series (x86/resctrl: Fix Platform QoS issues for
Hygon) which is in process of being added to resctrl.
---------------------------

> 
> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>

Thank you very much!


> 
> Reinette


Best regards,
Xiaochen Shen