about summary refs log tree commit diff
path: root/sysdeps/x86/bits/platform/x86.h
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2021-02-04 10:39:34 -0800
committerH.J. Lu <hjl.tools@gmail.com>2021-02-07 08:01:14 -0800
commit5ab25c88758810269607a066fcac399e29863510 (patch)
treefff85c2b2b481b413d71872bd5753f870557d89a /sysdeps/x86/bits/platform/x86.h
parentc3479fb7939898ec22c655c383454d6e8b982a67 (diff)
downloadglibc-5ab25c88758810269607a066fcac399e29863510.tar.gz
glibc-5ab25c88758810269607a066fcac399e29863510.tar.xz
glibc-5ab25c88758810269607a066fcac399e29863510.zip
x86: Add PTWRITE feature detection [BZ #27346]
1. Add CPUID_INDEX_14_ECX_0 for CPUID leaf 0x14 to detect PTWRITE feature
in EBX of CPUID leaf 0x14 with ECX == 0.
2. Add PTWRITE detection to CPU feature tests.
3. Add 2 static CPU feature tests.
Diffstat (limited to 'sysdeps/x86/bits/platform/x86.h')
-rw-r--r--sysdeps/x86/bits/platform/x86.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/sysdeps/x86/bits/platform/x86.h b/sysdeps/x86/bits/platform/x86.h
index 8f423ae721..c4850fc3cb 100644
--- a/sysdeps/x86/bits/platform/x86.h
+++ b/sysdeps/x86/bits/platform/x86.h
@@ -29,7 +29,8 @@ enum
   CPUID_INDEX_80000007,
   CPUID_INDEX_80000008,
   CPUID_INDEX_7_ECX_1,
-  CPUID_INDEX_19
+  CPUID_INDEX_19,
+  CPUID_INDEX_14_ECX_0
 };
 
 struct cpuid_feature
@@ -295,5 +296,11 @@ enum
        + cpuid_register_index_ebx * 8 * sizeof (unsigned int)),
 
   x86_cpu_AESKLE		= x86_cpu_index_19_ebx,
-  x86_cpu_WIDE_KL		= x86_cpu_index_19_ebx + 2
+  x86_cpu_WIDE_KL		= x86_cpu_index_19_ebx + 2,
+
+  x86_cpu_index_14_ecx_0_ebx
+    = (CPUID_INDEX_14_ECX_0 * 8 * 4 * sizeof (unsigned int)
+       + cpuid_register_index_ebx * 8 * sizeof (unsigned int)),
+
+  x86_cpu_PTWRITE		= x86_cpu_index_14_ecx_0_ebx + 4
 };