* AMD 3900X: FAIL: elf/tst-cpu-features-cpuinfo @ 2021-01-30 8:34 Winfried Magerl 2021-01-30 10:16 ` Winfried Magerl 0 siblings, 1 reply; 4+ messages in thread From: Winfried Magerl @ 2021-01-30 8:34 UTC (permalink / raw) To: libc-alpha Hello, I got a suspicious error when building current upcoming glibc-2.33: FAIL: elf/tst-cpu-features-cpuinfo The relavant details from elf/tst-cpu-features-cpuinfo.out (likely invariant_tsc can be ignored): Checking HAS_CPU_FEATURE (INVARIANT_TSC): HAS_CPU_FEATURE (INVARIANT_TSC): 1 cpuinfo (invariant_tsc): 0 *** missing in /proc/cpuinfo *** Checking HAS_CPU_FEATURE (SSBD): HAS_CPU_FEATURE (SSBD): 0 cpuinfo (ssbd): 1 *** failure *** Checking HAS_CPU_FEATURE (STIBP): HAS_CPU_FEATURE (STIBP): 0 cpuinfo (stibp): 1 *** failure *** 2 differences between /proc/cpuinfo and glibc code. The details of the build-system: cpu: AMD Ryzen 9 3900X 12-Core Processor os: openSUSE Tumbleweed 20210128 gcc: gcc-10-3.1.x86_64 binutils: binutils-2.35.1-1.1 Maybe this helps to track down the problem. From a quick look it's likely uncritical because the feature is simply missing (as opposed to a missdetected non-existing feature). regards winfried ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: AMD 3900X: FAIL: elf/tst-cpu-features-cpuinfo 2021-01-30 8:34 AMD 3900X: FAIL: elf/tst-cpu-features-cpuinfo Winfried Magerl @ 2021-01-30 10:16 ` Winfried Magerl 2021-01-30 13:59 ` [PATCH] x86: Check SSBD and STIBP only on Intel CPUs H.J. Lu 0 siblings, 1 reply; 4+ messages in thread From: Winfried Magerl @ 2021-01-30 10:16 UTC (permalink / raw) To: libc-alpha Hello, On Sat, Jan 30, 2021 at 09:34:56AM +0100, Winfried Magerl wrote: > Hello, > > I got a suspicious error when building current upcoming glibc-2.33: > > FAIL: elf/tst-cpu-features-cpuinfo > > The relavant details from elf/tst-cpu-features-cpuinfo.out > (likely invariant_tsc can be ignored): > > Checking HAS_CPU_FEATURE (INVARIANT_TSC): > HAS_CPU_FEATURE (INVARIANT_TSC): 1 > cpuinfo (invariant_tsc): 0 > *** missing in /proc/cpuinfo *** > Checking HAS_CPU_FEATURE (SSBD): > HAS_CPU_FEATURE (SSBD): 0 > cpuinfo (ssbd): 1 > *** failure *** > Checking HAS_CPU_FEATURE (STIBP): > HAS_CPU_FEATURE (STIBP): 0 > cpuinfo (stibp): 1 > *** failure *** > 2 differences between /proc/cpuinfo and glibc code. > > The details of the build-system: > cpu: AMD Ryzen 9 3900X 12-Core Processor > os: openSUSE Tumbleweed 20210128 > gcc: gcc-10-3.1.x86_64 > binutils: binutils-2.35.1-1.1 the missing kernel-version: openSUSE: kernel-default-5.10.9-1.2.x86_64 also tested with vanilla-kernels with identical result: linux-5.9.16 linux-5.11-rc5 > Maybe this helps to track down the problem. From a quick look it's > likely uncritical because the feature is simply missing (as opposed > to a missdetected non-existing feature). regards winfried ^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] x86: Check SSBD and STIBP only on Intel CPUs 2021-01-30 10:16 ` Winfried Magerl @ 2021-01-30 13:59 ` H.J. Lu 2021-01-30 16:26 ` Winfried Magerl 0 siblings, 1 reply; 4+ messages in thread From: H.J. Lu @ 2021-01-30 13:59 UTC (permalink / raw) To: GNU C Library [-- Attachment #1: Type: text/plain, Size: 1512 bytes --] On Sat, Jan 30, 2021 at 2:26 AM Winfried Magerl <winfried.magerl@t-online.de> wrote: > > Hello, > > On Sat, Jan 30, 2021 at 09:34:56AM +0100, Winfried Magerl wrote: > > Hello, > > > > I got a suspicious error when building current upcoming glibc-2.33: > > > > FAIL: elf/tst-cpu-features-cpuinfo > > > > The relavant details from elf/tst-cpu-features-cpuinfo.out > > (likely invariant_tsc can be ignored): > > > > Checking HAS_CPU_FEATURE (INVARIANT_TSC): > > HAS_CPU_FEATURE (INVARIANT_TSC): 1 > > cpuinfo (invariant_tsc): 0 > > *** missing in /proc/cpuinfo *** > > Checking HAS_CPU_FEATURE (SSBD): > > HAS_CPU_FEATURE (SSBD): 0 > > cpuinfo (ssbd): 1 > > *** failure *** > > Checking HAS_CPU_FEATURE (STIBP): > > HAS_CPU_FEATURE (STIBP): 0 > > cpuinfo (stibp): 1 > > *** failure *** > > 2 differences between /proc/cpuinfo and glibc code. > > > > The details of the build-system: > > cpu: AMD Ryzen 9 3900X 12-Core Processor > > os: openSUSE Tumbleweed 20210128 > > gcc: gcc-10-3.1.x86_64 > > binutils: binutils-2.35.1-1.1 > > the missing kernel-version: > openSUSE: kernel-default-5.10.9-1.2.x86_64 > > also tested with vanilla-kernels with identical result: > linux-5.9.16 > linux-5.11-rc5 > > > Maybe this helps to track down the problem. From a quick look it's > > likely uncritical because the feature is simply missing (as opposed > > to a missdetected non-existing feature). Try this. -- H.J. [-- Attachment #2: 0001-x86-Check-SSBD-and-STIBP-only-on-Intel-CPUs.patch --] [-- Type: text/x-patch, Size: 2536 bytes --] From 132ba6e1daf5463975467cf3af5ec0f0602d96e9 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" <hjl.tools@gmail.com> Date: Sat, 30 Jan 2021 05:44:40 -0800 Subject: [PATCH] x86: Check SSBD and STIBP only on Intel CPUs Since /proc/cpuinfo reports different SSBD and STIBP on AMD CPUs, check SSBD and STIBP only on Intel CPUs. Also /proc/cpuinfo doesn't report IBRS_IBPB. --- sysdeps/x86/tst-cpu-features-cpuinfo.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sysdeps/x86/tst-cpu-features-cpuinfo.c b/sysdeps/x86/tst-cpu-features-cpuinfo.c index 3c2fa7d9b6..ebe7337ab8 100644 --- a/sysdeps/x86/tst-cpu-features-cpuinfo.c +++ b/sysdeps/x86/tst-cpu-features-cpuinfo.c @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see <https://www.gnu.org/licenses/>. */ -#include <sys/platform/x86.h> +#include <cpu-features.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -99,6 +99,7 @@ static int do_test (int argc, char **argv) { int fails = 0; + const struct cpu_features *cpu_features = __get_cpu_features (); get_cpuinfo (); fails += CHECK_PROC (acpi, ACPI); @@ -159,7 +160,10 @@ do_test (int argc, char **argv) fails += CHECK_PROC (hle, HLE); fails += CHECK_PROC (ht, HTT); fails += CHECK_PROC (hybrid, HYBRID); - fails += CHECK_PROC (ibrs, IBRS_IBPB); +#if 0 + /* NB: /proc/cpuinfo doesn't report this feature. */ + fails += CHECK_PROC (ibrs_ibpb, IBRS_IBPB); +#endif fails += CHECK_PROC (ibt, IBT); fails += CHECK_PROC (invariant_tsc, INVARIANT_TSC); fails += CHECK_PROC (invpcid, INVPCID); @@ -220,7 +224,9 @@ do_test (int argc, char **argv) fails += CHECK_PROC (smep, SMEP); fails += CHECK_PROC (smx, SMX); fails += CHECK_PROC (ss, SS); - fails += CHECK_PROC (ssbd, SSBD); + /* NB: /proc/cpuinfo reports different SSBD on AMD CPUs. */ + if (cpu_features->basic.kind == arch_kind_intel) + fails += CHECK_PROC (ssbd, SSBD); fails += CHECK_PROC (sse, SSE); fails += CHECK_PROC (sse2, SSE2); fails += CHECK_PROC (pni, SSE3); @@ -228,7 +234,9 @@ do_test (int argc, char **argv) fails += CHECK_PROC (sse4_2, SSE4_2); fails += CHECK_PROC (sse4a, SSE4A); fails += CHECK_PROC (ssse3, SSSE3); - fails += CHECK_PROC (stibp, STIBP); + /* NB: /proc/cpuinfo reports different STIBP on AMD CPUs. */ + if (cpu_features->basic.kind == arch_kind_intel) + fails += CHECK_PROC (stibp, STIBP); fails += CHECK_PROC (svm, SVM); #ifdef __x86_64__ /* NB: SYSCALL_SYSRET is 64-bit only. */ -- 2.29.2 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86: Check SSBD and STIBP only on Intel CPUs 2021-01-30 13:59 ` [PATCH] x86: Check SSBD and STIBP only on Intel CPUs H.J. Lu @ 2021-01-30 16:26 ` Winfried Magerl 0 siblings, 0 replies; 4+ messages in thread From: Winfried Magerl @ 2021-01-30 16:26 UTC (permalink / raw) To: libc-alpha Hello, On Sat, Jan 30, 2021 at 05:59:55AM -0800, H.J. Lu via Libc-alpha wrote: > On Sat, Jan 30, 2021 at 2:26 AM Winfried Magerl > <winfried.magerl@t-online.de> wrote: > > > > Hello, > > > > On Sat, Jan 30, 2021 at 09:34:56AM +0100, Winfried Magerl wrote: > > > Hello, > > > > > > I got a suspicious error when building current upcoming glibc-2.33: > > > > > > FAIL: elf/tst-cpu-features-cpuinfo > > > > > > The relavant details from elf/tst-cpu-features-cpuinfo.out > > > (likely invariant_tsc can be ignored): > > > > > > Checking HAS_CPU_FEATURE (INVARIANT_TSC): > > > HAS_CPU_FEATURE (INVARIANT_TSC): 1 > > > cpuinfo (invariant_tsc): 0 > > > *** missing in /proc/cpuinfo *** > > > Checking HAS_CPU_FEATURE (SSBD): > > > HAS_CPU_FEATURE (SSBD): 0 > > > cpuinfo (ssbd): 1 > > > *** failure *** > > > Checking HAS_CPU_FEATURE (STIBP): > > > HAS_CPU_FEATURE (STIBP): 0 > > > cpuinfo (stibp): 1 > > > *** failure *** > > > 2 differences between /proc/cpuinfo and glibc code. > > > > > > The details of the build-system: > > > cpu: AMD Ryzen 9 3900X 12-Core Processor > > > os: openSUSE Tumbleweed 20210128 > > > gcc: gcc-10-3.1.x86_64 > > > binutils: binutils-2.35.1-1.1 > > > > the missing kernel-version: > > openSUSE: kernel-default-5.10.9-1.2.x86_64 > > > > also tested with vanilla-kernels with identical result: > > linux-5.9.16 > > linux-5.11-rc5 > > > > > Maybe this helps to track down the problem. From a quick look it's > > > likely uncritical because the feature is simply missing (as opposed > > > to a missdetected non-existing feature). > > Try this. Thank you! I can confirm that the patch results in a successfull run of the test. The expected result when the check for ssbd and stibp is done for intel-cpus only. regards winfried ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-01-30 16:26 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-01-30 8:34 AMD 3900X: FAIL: elf/tst-cpu-features-cpuinfo Winfried Magerl 2021-01-30 10:16 ` Winfried Magerl 2021-01-30 13:59 ` [PATCH] x86: Check SSBD and STIBP only on Intel CPUs H.J. Lu 2021-01-30 16:26 ` Winfried Magerl
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).