]> git.ipfire.org Git - thirdparty/glibc.git/commit
elf: Fix tst-cpu-features-cpuinfo on some AMD systems (BZ #28090)
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 15 Jul 2021 11:52:44 +0000 (08:52 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 19 Jul 2021 17:12:29 +0000 (14:12 -0300)
commit469761eac842663365bba3dacd4cdf15a2ae328d
tree570826e6942f9bc0bb7eec6bb34dedec141e0d01
parent5adb0e14a5cc9e011e58a7aaf193b598ecbd7b07
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 <hjl.tools@gmail.com>
manual/platform.texi
sysdeps/x86/bits/platform/x86.h
sysdeps/x86/include/cpu-features.h
sysdeps/x86/tst-cpu-features-cpuinfo.c