Message ID | 87sg5o7705.fsf@oldenburg.str.redhat.com |
---|---|
State | New |
Headers | show |
Series | x86: Do not check FSRM in tst-cpu-features-cpuinfo | expand |
On Mon, Feb 22, 2021 at 2:17 AM Florian Weimer via Libc-alpha <libc-alpha@sourceware.org> wrote: > > Current kernels do not report this feature bit, so the test fails > if the hardware supports it. > > According to > > [PATCH v2] i386: Add the support for AMD EPYC 3rd generation processors > <https://lists.gnu.org/archive/html/qemu-devel/2021-02/msg03370.html> > > some AMD processors set this CPUID bit. > > --- > sysdeps/x86/tst-cpu-features-cpuinfo.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/sysdeps/x86/tst-cpu-features-cpuinfo.c b/sysdeps/x86/tst-cpu-features-cpuinfo.c > index 75e7eb9352..a6a873b59c 100644 > --- a/sysdeps/x86/tst-cpu-features-cpuinfo.c > +++ b/sysdeps/x86/tst-cpu-features-cpuinfo.c > @@ -153,7 +153,10 @@ do_test (int argc, char **argv) > fails += CHECK_PROC (fma4, FMA4); > fails += CHECK_PROC (fpu, FPU); > fails += CHECK_PROC (fsgsbase, FSGSBASE); > +#if 0 > + /* NB: /proc/cpuinfo doesn't report this feature. */ > fails += CHECK_PROC (fsrm, FSRM); > +#endif > fails += CHECK_PROC (fxsr, FXSR); > fails += CHECK_PROC (gfni, GFNI); > fails += CHECK_PROC (hle, HLE); > Since kernel does report it on Intel CPUs, please change it to /* NB: /proc/cpuinfo reports this feature on Intel CPUs. */ if (cpu_features->basic.kind == arch_kind_intel) on top of https://sourceware.org/pipermail/libc-alpha/2021-January/122171.html Thanks.
* H. J. Lu: > On Mon, Feb 22, 2021 at 2:17 AM Florian Weimer via Libc-alpha > <libc-alpha@sourceware.org> wrote: >> >> Current kernels do not report this feature bit, so the test fails >> if the hardware supports it. >> >> According to >> >> [PATCH v2] i386: Add the support for AMD EPYC 3rd generation processors >> <https://lists.gnu.org/archive/html/qemu-devel/2021-02/msg03370.html> >> >> some AMD processors set this CPUID bit. >> >> --- >> sysdeps/x86/tst-cpu-features-cpuinfo.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/sysdeps/x86/tst-cpu-features-cpuinfo.c b/sysdeps/x86/tst-cpu-features-cpuinfo.c >> index 75e7eb9352..a6a873b59c 100644 >> --- a/sysdeps/x86/tst-cpu-features-cpuinfo.c >> +++ b/sysdeps/x86/tst-cpu-features-cpuinfo.c >> @@ -153,7 +153,10 @@ do_test (int argc, char **argv) >> fails += CHECK_PROC (fma4, FMA4); >> fails += CHECK_PROC (fpu, FPU); >> fails += CHECK_PROC (fsgsbase, FSGSBASE); >> +#if 0 >> + /* NB: /proc/cpuinfo doesn't report this feature. */ >> fails += CHECK_PROC (fsrm, FSRM); >> +#endif >> fails += CHECK_PROC (fxsr, FXSR); >> fails += CHECK_PROC (gfni, GFNI); >> fails += CHECK_PROC (hle, HLE); >> > > Since kernel does report it on Intel CPUs, please change it to > > /* NB: /proc/cpuinfo reports this feature on Intel CPUs. */ > if (cpu_features->basic.kind == arch_kind_intel) > > on top of > > https://sourceware.org/pipermail/libc-alpha/2021-January/122171.html Oh, it looks like that kernel support has only been added in Linux 5.6. Does this mean that tst-cpu-features-cpuinfo.c needs to check kernel versions? Thanks, Florian
On Mon, Feb 22, 2021 at 5:15 AM Florian Weimer <fweimer@redhat.com> wrote: > > * H. J. Lu: > > > On Mon, Feb 22, 2021 at 2:17 AM Florian Weimer via Libc-alpha > > <libc-alpha@sourceware.org> wrote: > >> > >> Current kernels do not report this feature bit, so the test fails > >> if the hardware supports it. > >> > >> According to > >> > >> [PATCH v2] i386: Add the support for AMD EPYC 3rd generation processors > >> <https://lists.gnu.org/archive/html/qemu-devel/2021-02/msg03370.html> > >> > >> some AMD processors set this CPUID bit. > >> > >> --- > >> sysdeps/x86/tst-cpu-features-cpuinfo.c | 3 +++ > >> 1 file changed, 3 insertions(+) > >> > >> diff --git a/sysdeps/x86/tst-cpu-features-cpuinfo.c b/sysdeps/x86/tst-cpu-features-cpuinfo.c > >> index 75e7eb9352..a6a873b59c 100644 > >> --- a/sysdeps/x86/tst-cpu-features-cpuinfo.c > >> +++ b/sysdeps/x86/tst-cpu-features-cpuinfo.c > >> @@ -153,7 +153,10 @@ do_test (int argc, char **argv) > >> fails += CHECK_PROC (fma4, FMA4); > >> fails += CHECK_PROC (fpu, FPU); > >> fails += CHECK_PROC (fsgsbase, FSGSBASE); > >> +#if 0 > >> + /* NB: /proc/cpuinfo doesn't report this feature. */ > >> fails += CHECK_PROC (fsrm, FSRM); > >> +#endif > >> fails += CHECK_PROC (fxsr, FXSR); > >> fails += CHECK_PROC (gfni, GFNI); > >> fails += CHECK_PROC (hle, HLE); > >> > > > > Since kernel does report it on Intel CPUs, please change it to > > > > /* NB: /proc/cpuinfo reports this feature on Intel CPUs. */ > > if (cpu_features->basic.kind == arch_kind_intel) > > > > on top of > > > > https://sourceware.org/pipermail/libc-alpha/2021-January/122171.html > > Oh, it looks like that kernel support has only been added in Linux 5.6. > Does this mean that tst-cpu-features-cpuinfo.c needs to check kernel > versions? Good idea. BTW, we are checking GCC versions for __builtin_cpu_supports.
diff --git a/sysdeps/x86/tst-cpu-features-cpuinfo.c b/sysdeps/x86/tst-cpu-features-cpuinfo.c index 75e7eb9352..a6a873b59c 100644 --- a/sysdeps/x86/tst-cpu-features-cpuinfo.c +++ b/sysdeps/x86/tst-cpu-features-cpuinfo.c @@ -153,7 +153,10 @@ do_test (int argc, char **argv) fails += CHECK_PROC (fma4, FMA4); fails += CHECK_PROC (fpu, FPU); fails += CHECK_PROC (fsgsbase, FSGSBASE); +#if 0 + /* NB: /proc/cpuinfo doesn't report this feature. */ fails += CHECK_PROC (fsrm, FSRM); +#endif fails += CHECK_PROC (fxsr, FXSR); fails += CHECK_PROC (gfni, GFNI); fails += CHECK_PROC (hle, HLE);