From 469761eac842663365bba3dacd4cdf15a2ae328d Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Thu, 15 Jul 2021 08:52:44 -0300 Subject: elf: Fix tst-cpu-features-cpuinfo on some AMD systems (BZ #28090) The SSBD feature is implemented in 2 different ways on AMD processors: newer systems (Zen3) provides AMD_SSBD (function 8000_0008, EBX[24]), while older system provides AMD_VIRT_SSBD (function 8000_0008, EBX[25]). However for AMD_VIRT_SSBD, kernel shows both 'ssdb' and 'virt_ssdb' on /proc/cpuinfo; while for AMD_SSBD only 'ssdb' is provided. This now check is AMD_SSBD is set to check for 'ssbd', otherwise check if AMD_VIRT_SSDB is set to check for 'virt_ssbd'. Checked on x86_64-linux-gnu on a Ryzen 9 5900x. Reviewed-by: H.J. Lu --- sysdeps/x86/bits/platform/x86.h | 1 + 1 file changed, 1 insertion(+) (limited to 'sysdeps/x86/bits') diff --git a/sysdeps/x86/bits/platform/x86.h b/sysdeps/x86/bits/platform/x86.h index 5509b1a..2b25760 100644 --- a/sysdeps/x86/bits/platform/x86.h +++ b/sysdeps/x86/bits/platform/x86.h @@ -282,6 +282,7 @@ enum x86_cpu_AMD_IBRS = x86_cpu_index_80000008_ebx + 14, x86_cpu_AMD_STIBP = x86_cpu_index_80000008_ebx + 15, x86_cpu_AMD_SSBD = x86_cpu_index_80000008_ebx + 24, + x86_cpu_AMD_VIRT_SSBD = x86_cpu_index_80000008_ebx + 25, x86_cpu_index_7_ecx_1_eax = (CPUID_INDEX_7_ECX_1 * 8 * 4 * sizeof (unsigned int) -- cgit v1.1