lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <06157ac8-d84b-4887-a7e8-50fe5909febe@intel.com>
Date: Thu, 4 Dec 2025 15:48:18 -0800
From: Reinette Chatre <reinette.chatre@...el.com>
To: Xiaochen Shen <shenxiaochen@...n-hieco.net>, <tony.luck@...el.com>,
	<bp@...en8.de>, <fenghuay@...dia.com>
CC: <babu.moger@....com>, <james.morse@....com>, <Dave.Martin@....com>,
	<x86@...nel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/3] selftests/resctrl: Add CPU vendor detection for Hygon

Hi Xiaochen,

On 12/4/25 4:38 AM, 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@...n-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 cd3adfc14969..df2a59e0141e 100644
> --- a/tools/testing/selftests/resctrl/resctrl.h
> +++ b/tools/testing/selftests/resctrl/resctrl.h
> @@ -38,6 +38,7 @@
>   */
>  #define ARCH_INTEL     1
>  #define ARCH_AMD       2
> +#define ARCH_HYGON     3

The comment before these defines attempts to provide guidance but it is clearly still
quite subtle that these values are required to be unique bits. Consider for example
their usage in test_vendor_specific_check():
	return get_vendor() & test->vendor_specific

This should either be 4 or a better solution is probably to switch all of these to use
BIT() (linux/bits.h is available via tools/include that is already in include path).

Reinette


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ