mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
x86: Fix tst-cpu-features-cpuinfo on Ryzen 9 (BZ #27873)
AMD define different flags for IRPB, IBRS, and STIPBP [1], so new x86_64_cpu are added and IBRS_IBPB is only tested for Intel. The SSDB is also defined and implemented different on AMD [2], and also a new AMD_SSDB flag is added. It should map to the cpuinfo 'ssdb' on recent AMD cpus. It fixes tst-cpu-features-cpuinfo and tst-cpu-features-cpuinfo-static on recent AMD cpus. Checked on x86_64-linux-gnu on AMD Ryzen 9 5900X. [1] https://developer.amd.com/wp-content/resources/Architecture_Guidelines_Update_Indirect_Branch_Control.pdf [2] https://bugzilla.kernel.org/show_bug.cgi?id=199889 Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
This commit is contained in:
@@ -289,6 +289,10 @@ enum
|
||||
|
||||
/* EBX. */
|
||||
#define bit_cpu_WBNOINVD (1u << 9)
|
||||
#define bit_cpu_AMD_IBPB (1u << 12)
|
||||
#define bit_cpu_AMD_IBRS (1u << 14)
|
||||
#define bit_cpu_AMD_STIBP (1u << 15)
|
||||
#define bit_cpu_AMD_SSBD (1u << 24)
|
||||
|
||||
/* CPUID_INDEX_7_ECX_1. */
|
||||
|
||||
@@ -519,6 +523,10 @@ enum
|
||||
|
||||
/* EBX. */
|
||||
#define index_cpu_WBNOINVD CPUID_INDEX_80000008
|
||||
#define index_cpu_AMD_IBPB CPUID_INDEX_80000008
|
||||
#define index_cpu_AMD_IBRS CPUID_INDEX_80000008
|
||||
#define index_cpu_AMD_STIBP CPUID_INDEX_80000008
|
||||
#define index_cpu_AMD_SSBD CPUID_INDEX_80000008
|
||||
|
||||
/* CPUID_INDEX_7_ECX_1. */
|
||||
|
||||
@@ -749,6 +757,10 @@ enum
|
||||
|
||||
/* EBX. */
|
||||
#define reg_WBNOINVD ebx
|
||||
#define reg_AMD_IBPB ebx
|
||||
#define reg_AMD_IBRS ebx
|
||||
#define reg_AMD_STIBP ebx
|
||||
#define reg_AMD_SSBD ebx
|
||||
|
||||
/* CPUID_INDEX_7_ECX_1. */
|
||||
|
||||
|
Reference in New Issue
Block a user