]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
x86: Black list more Intel CPUs for TSX [BZ #27398]
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 14 Jan 2022 22:48:01 +0000 (14:48 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 18 Jan 2022 22:20:09 +0000 (14:20 -0800)
Disable TSX and enable RTM_ALWAYS_ABORT for Intel CPUs listed in:

https://www.intel.com/content/www/us/en/support/articles/000059422/processors.html

This fixes BZ #27398.

Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
sysdeps/x86/cpu-features.c

index 772ccf8e9195e3b7a7699e029f55e5883ed2195a..514226b378890321591e6ed68c2e7babd73c792c 100644 (file)
@@ -507,11 +507,39 @@ init_cpu_features (struct cpu_features *cpu_features)
              break;
            }
 
-        /* Disable TSX on some Haswell processors to avoid TSX on kernels that
-           weren't updated with the latest microcode package (which disables
-           broken feature by default).  */
+        /* Disable TSX on some processors to avoid TSX on kernels that
+           weren't updated with the latest microcode package (which
+           disables broken feature by default).  */
         switch (model)
            {
+           case 0x55:
+             if (stepping <= 5)
+               goto disable_tsx;
+             break;
+           case 0x8e:
+             /* NB: Although the errata documents that for model == 0x8e,
+                only 0xb stepping or lower are impacted, the intention of
+                the errata was to disable TSX on all client processors on
+                all steppings.  Include 0xc stepping which is an Intel
+                Core i7-8665U, a client mobile processor.  */
+           case 0x9e:
+             if (stepping > 0xc)
+               break;
+             /* Fall through.  */
+           case 0x4e:
+           case 0x5e:
+             {
+               /* Disable Intel TSX and enable RTM_ALWAYS_ABORT for
+                  processors listed in:
+
+https://www.intel.com/content/www/us/en/support/articles/000059422/processors.html
+                */
+disable_tsx:
+               CPU_FEATURE_UNSET (cpu_features, HLE);
+               CPU_FEATURE_UNSET (cpu_features, RTM);
+               CPU_FEATURE_SET (cpu_features, RTM_ALWAYS_ABORT);
+             }
+             break;
            case 0x3f:
              /* Xeon E7 v3 with stepping >= 4 has working TSX.  */
              if (stepping >= 4)