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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <028b83d5-6f48-4692-ada5-bd8f9c1cf010@open-hieco.net>
Date: Fri, 5 Dec 2025 15:01:44 +0800
From: Xiaochen Shen <shenxiaochen@...n-hieco.net>
To: Reinette Chatre <reinette.chatre@...el.com>, 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, shenxiaochen@...n-hieco.net
Subject: Re: [PATCH 1/3] selftests/resctrl: Add CPU vendor detection for Hygon

Hi Reinette,

On 12/5/2025 7:48 AM, Reinette Chatre wrote:
>>  #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


Thank you. How about this code change?

+#include <linux/bits.h>

...

-#define ARCH_INTEL     1
-#define ARCH_AMD       2
+#define ARCH_INTEL     BIT(0)
+#define ARCH_AMD       BIT(1)
+#define ARCH_HYGON     BIT(2)


Best regards,
Xiaochen Shen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ