arrfab / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone

Blame SOURCES/glibc-rh1641981.patch

147e83
commit c3d8dc45c9df199b8334599a6cbd98c9950dba62
147e83
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
147e83
Date:   Thu Oct 11 15:18:40 2018 -0300
147e83
147e83
    x86: Fix Haswell strong flags (BZ#23709)
147e83
    
147e83
    Th commit 'Disable TSX on some Haswell processors.' (2702856bf4) changed the
147e83
    default flags for Haswell models.  Previously, new models were handled by the
147e83
    default switch path, which assumed a Core i3/i5/i7 if AVX is available. After
147e83
    the patch, Haswell models (0x3f, 0x3c, 0x45, 0x46) do not set the flags
147e83
    Fast_Rep_String, Fast_Unaligned_Load, Fast_Unaligned_Copy, and
147e83
    Prefer_PMINUB_for_stringop (only the TSX one).
147e83
    
147e83
    This patch fixes it by disentangle the TSX flag handling from the memory
147e83
    optimization ones.  The strstr case cited on patch now selects the
147e83
    __strstr_sse2_unaligned as expected for the Haswell cpu.
147e83
    
147e83
    Checked on x86_64-linux-gnu.
147e83
    
147e83
            [BZ #23709]
147e83
            * sysdeps/x86/cpu-features.c (init_cpu_features): Set TSX bits
147e83
            independently of other flags.
147e83
147e83
diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
147e83
index 0667e486959a8a91..d134ef3a92cbc83d 100644
147e83
--- a/sysdeps/x86/cpu-features.c
147e83
+++ b/sysdeps/x86/cpu-features.c
147e83
@@ -133,7 +133,13 @@ init_cpu_features (struct cpu_features *cpu_features)
147e83
 		    | bit_Fast_Unaligned_Load
147e83
 		    | bit_Prefer_PMINUB_for_stringop);
147e83
 	      break;
147e83
+	    }
147e83
 
147e83
+	 /* Disable TSX on some Haswell processors to avoid TSX on kernels that
147e83
+	    weren't updated with the latest microcode package (which disables
147e83
+	    broken feature by default).  */
147e83
+	 switch (model)
147e83
+	    {
147e83
 	    case 0x3f:
147e83
 	      /* Xeon E7 v3 with stepping >= 4 has working TSX.  */
147e83
 	      if (stepping >= 4)