Fix elf: Do not duplicate the GLIBC_TUNABLES string

Message ID ZYIKpyKCN7YhXDXI@gmail.com
State Committed
Commit cad5703e4f80841b7f7e3fe57127bd0df7ddb86e
Headers
Series Fix elf: Do not duplicate the GLIBC_TUNABLES string |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
redhat-pt-bot/TryBot-32bit success Build for i686
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 warning Patch is already merged
linaro-tcwg-bot/tcwg_glibc_build--master-arm warning Patch is already merged

Commit Message

H.J. Lu Dec. 19, 2023, 9:27 p.m. UTC
  Fix issues in sysdeps/x86/tst-hwcap-tunables.c added by

Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Dec 6 10:24:01 2023 -0300

    elf: Do not duplicate the GLIBC_TUNABLES string

1. -AVX,-AVX2,-AVX512F should be used to disable AVX, AVX2 and AVX512.
2. AVX512 IFUNC functions check AVX512VL.  -AVX512VL should be added
to disable these functions.

This fixed:

FAIL: elf/tst-hwcap-tunables
...
[0] Spawned test for -Prefer_ERMS,-Prefer_FSRM,-AVX,-AVX2,-AVX_Usable,-AVX2_Usable,-AVX512F_Usable,-SSE4_1,-SSE4_2,-SSSE3,-Fast_Unaligned_Load,-ERMS,-AVX_Fast_Unaligned_Load
error: subprocess failed: tst-tunables
error:   unexpected output from subprocess
../sysdeps/x86/tst-hwcap-tunables.c:91: numeric comparison failure
   left: 1 (0x1); from: impls[i].usable
  right: 0 (0x0); from: false
../sysdeps/x86/tst-hwcap-tunables.c:91: numeric comparison failure
   left: 1 (0x1); from: impls[i].usable
  right: 0 (0x0); from: false
../sysdeps/x86/tst-hwcap-tunables.c:91: numeric comparison failure
   left: 1 (0x1); from: impls[i].usable
  right: 0 (0x0); from: false
../sysdeps/x86/tst-hwcap-tunables.c:91: numeric comparison failure
   left: 1 (0x1); from: impls[i].usable
  right: 0 (0x0); from: false
../sysdeps/x86/tst-hwcap-tunables.c:91: numeric comparison failure
   left: 1 (0x1); from: impls[i].usable
  right: 0 (0x0); from: false

[1] Spawned test for ,-,-Prefer_ERMS,-Prefer_FSRM,-AVX,-AVX2,-AVX_Usable,-AVX2_Usable,-AVX512F_Usable,-SSE4_1,-SSE4_2,,-SSSE3,-Fast_Unaligned_Load,,-,-ERMS,-AVX_Fast_Unaligned_Load,-,
error: subprocess failed: tst-tunables
error:   unexpected output from subprocess
../sysdeps/x86/tst-hwcap-tunables.c:91: numeric comparison failure
   left: 1 (0x1); from: impls[i].usable
  right: 0 (0x0); from: false
../sysdeps/x86/tst-hwcap-tunables.c:91: numeric comparison failure
   left: 1 (0x1); from: impls[i].usable
  right: 0 (0x0); from: false
../sysdeps/x86/tst-hwcap-tunables.c:91: numeric comparison failure
   left: 1 (0x1); from: impls[i].usable
  right: 0 (0x0); from: false
../sysdeps/x86/tst-hwcap-tunables.c:91: numeric comparison failure
   left: 1 (0x1); from: impls[i].usable
  right: 0 (0x0); from: false
../sysdeps/x86/tst-hwcap-tunables.c:91: numeric comparison failure
   left: 1 (0x1); from: impls[i].usable
  right: 0 (0x0); from: false

error: 2 test failures

on Intel Tiger Lake.

I am checking it in as an obvious fix.

H.J.
---
 sysdeps/x86/tst-hwcap-tunables.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
  

Comments

Adhemerval Zanella Netto Dec. 19, 2023, 9:35 p.m. UTC | #1
On 19/12/23 18:27, H.J. Lu wrote:
> Fix issues in sysdeps/x86/tst-hwcap-tunables.c added by
> 
> Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
> Date:   Wed Dec 6 10:24:01 2023 -0300
> 
>     elf: Do not duplicate the GLIBC_TUNABLES string
> 
> 1. -AVX,-AVX2,-AVX512F should be used to disable AVX, AVX2 and AVX512.
> 2. AVX512 IFUNC functions check AVX512VL.  -AVX512VL should be added
> to disable these functions.
> 
> This fixed:
> 
> FAIL: elf/tst-hwcap-tunables
> ...
> [0] Spawned test for -Prefer_ERMS,-Prefer_FSRM,-AVX,-AVX2,-AVX_Usable,-AVX2_Usable,-AVX512F_Usable,-SSE4_1,-SSE4_2,-SSSE3,-Fast_Unaligned_Load,-ERMS,-AVX_Fast_Unaligned_Load
> error: subprocess failed: tst-tunables
> error:   unexpected output from subprocess
> ../sysdeps/x86/tst-hwcap-tunables.c:91: numeric comparison failure
>    left: 1 (0x1); from: impls[i].usable
>   right: 0 (0x0); from: false
> ../sysdeps/x86/tst-hwcap-tunables.c:91: numeric comparison failure
>    left: 1 (0x1); from: impls[i].usable
>   right: 0 (0x0); from: false
> ../sysdeps/x86/tst-hwcap-tunables.c:91: numeric comparison failure
>    left: 1 (0x1); from: impls[i].usable
>   right: 0 (0x0); from: false
> ../sysdeps/x86/tst-hwcap-tunables.c:91: numeric comparison failure
>    left: 1 (0x1); from: impls[i].usable
>   right: 0 (0x0); from: false
> ../sysdeps/x86/tst-hwcap-tunables.c:91: numeric comparison failure
>    left: 1 (0x1); from: impls[i].usable
>   right: 0 (0x0); from: false
> 
> [1] Spawned test for ,-,-Prefer_ERMS,-Prefer_FSRM,-AVX,-AVX2,-AVX_Usable,-AVX2_Usable,-AVX512F_Usable,-SSE4_1,-SSE4_2,,-SSSE3,-Fast_Unaligned_Load,,-,-ERMS,-AVX_Fast_Unaligned_Load,-,
> error: subprocess failed: tst-tunables
> error:   unexpected output from subprocess
> ../sysdeps/x86/tst-hwcap-tunables.c:91: numeric comparison failure
>    left: 1 (0x1); from: impls[i].usable
>   right: 0 (0x0); from: false
> ../sysdeps/x86/tst-hwcap-tunables.c:91: numeric comparison failure
>    left: 1 (0x1); from: impls[i].usable
>   right: 0 (0x0); from: false
> ../sysdeps/x86/tst-hwcap-tunables.c:91: numeric comparison failure
>    left: 1 (0x1); from: impls[i].usable
>   right: 0 (0x0); from: false
> ../sysdeps/x86/tst-hwcap-tunables.c:91: numeric comparison failure
>    left: 1 (0x1); from: impls[i].usable
>   right: 0 (0x0); from: false
> ../sysdeps/x86/tst-hwcap-tunables.c:91: numeric comparison failure
>    left: 1 (0x1); from: impls[i].usable
>   right: 0 (0x0); from: false
> 
> error: 2 test failures
> 
> on Intel Tiger Lake.
> 
> I am checking it in as an obvious fix.
> 
> H.J.
> ---
>  sysdeps/x86/tst-hwcap-tunables.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/sysdeps/x86/tst-hwcap-tunables.c b/sysdeps/x86/tst-hwcap-tunables.c
> index 01a9377f7e..4e36aa077d 100644
> --- a/sysdeps/x86/tst-hwcap-tunables.c
> +++ b/sysdeps/x86/tst-hwcap-tunables.c
> @@ -58,17 +58,17 @@ static const struct test_t
>  {
>    {
>      /* Disable everything.  */
> -    "-Prefer_ERMS,-Prefer_FSRM,-AVX,-AVX2,-AVX_Usable,-AVX2_Usable,"
> -    "-AVX512F_Usable,-SSE4_1,-SSE4_2,-SSSE3,-Fast_Unaligned_Load,-ERMS,"
> +    "-Prefer_ERMS,-Prefer_FSRM,-AVX,-AVX2,-AVX512F,-AVX512VL,"
> +    "-SSE4_1,-SSE4_2,-SSSE3,-Fast_Unaligned_Load,-ERMS,"
>      "-AVX_Fast_Unaligned_Load",
>      test_1,
>      array_length (test_1)
>    },
>    {
>      /* Same as before, but with some empty suboptions.  */
> -    ",-,-Prefer_ERMS,-Prefer_FSRM,-AVX,-AVX2,-AVX_Usable,-AVX2_Usable,"
> -    "-AVX512F_Usable,-SSE4_1,-SSE4_2,,-SSSE3,-Fast_Unaligned_Load,,-,-ERMS,"
> -    "-AVX_Fast_Unaligned_Load,-,",
> +    ",-,-Prefer_ERMS,-Prefer_FSRM,-AVX,-AVX2,-AVX512F,-AVX512VL,"
> +    "-SSE4_1,-SSE4_2,-SSSE3,-Fast_Unaligned_Load,,-,"
> +    "-ERMS,-AVX_Fast_Unaligned_Load,-,",
>      test_1,
>      array_length (test_1)
>    }

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
  

Patch

diff --git a/sysdeps/x86/tst-hwcap-tunables.c b/sysdeps/x86/tst-hwcap-tunables.c
index 01a9377f7e..4e36aa077d 100644
--- a/sysdeps/x86/tst-hwcap-tunables.c
+++ b/sysdeps/x86/tst-hwcap-tunables.c
@@ -58,17 +58,17 @@  static const struct test_t
 {
   {
     /* Disable everything.  */
-    "-Prefer_ERMS,-Prefer_FSRM,-AVX,-AVX2,-AVX_Usable,-AVX2_Usable,"
-    "-AVX512F_Usable,-SSE4_1,-SSE4_2,-SSSE3,-Fast_Unaligned_Load,-ERMS,"
+    "-Prefer_ERMS,-Prefer_FSRM,-AVX,-AVX2,-AVX512F,-AVX512VL,"
+    "-SSE4_1,-SSE4_2,-SSSE3,-Fast_Unaligned_Load,-ERMS,"
     "-AVX_Fast_Unaligned_Load",
     test_1,
     array_length (test_1)
   },
   {
     /* Same as before, but with some empty suboptions.  */
-    ",-,-Prefer_ERMS,-Prefer_FSRM,-AVX,-AVX2,-AVX_Usable,-AVX2_Usable,"
-    "-AVX512F_Usable,-SSE4_1,-SSE4_2,,-SSSE3,-Fast_Unaligned_Load,,-,-ERMS,"
-    "-AVX_Fast_Unaligned_Load,-,",
+    ",-,-Prefer_ERMS,-Prefer_FSRM,-AVX,-AVX2,-AVX512F,-AVX512VL,"
+    "-SSE4_1,-SSE4_2,-SSSE3,-Fast_Unaligned_Load,,-,"
+    "-ERMS,-AVX_Fast_Unaligned_Load,-,",
     test_1,
     array_length (test_1)
   }