e354a5
commit c712401bc641b66d9bd558884751d8979e2e0e96
e354a5
Author: H.J. Lu <hjl.tools@gmail.com>
e354a5
Date:   Thu Oct 8 08:38:03 2020 -0700
e354a5
e354a5
    <sys/platform/x86.h>: Add Intel HRESET support
e354a5
    
e354a5
    Add Intel HRESET support to <sys/platform/x86.h>.
e354a5
e354a5
diff --git a/manual/platform.texi b/manual/platform.texi
e354a5
index 283f255679643d3e..1e44525552f5bda5 100644
e354a5
--- a/manual/platform.texi
e354a5
+++ b/manual/platform.texi
e354a5
@@ -346,6 +346,9 @@ extensions.
e354a5
 @item
e354a5
 @code{HTT} -- Max APIC IDs reserved field is Valid.
e354a5
 
e354a5
+@item
e354a5
+@code{HRESET} -- History reset.
e354a5
+
e354a5
 @item
e354a5
 @code{HYBRID} -- Hybrid processor.
e354a5
 
e354a5
diff --git a/sysdeps/x86/sys/platform/x86.h b/sysdeps/x86/sys/platform/x86.h
e354a5
index 0942ad7a7f7d4ce2..357c6f1c5605d82d 100644
e354a5
--- a/sysdeps/x86/sys/platform/x86.h
e354a5
+++ b/sysdeps/x86/sys/platform/x86.h
e354a5
@@ -313,6 +313,7 @@ extern const struct cpu_features *__x86_get_cpu_features (unsigned int)
e354a5
 /* EAX.  */
e354a5
 #define bit_cpu_AVX_VNNI	(1u << 4)
e354a5
 #define bit_cpu_AVX512_BF16	(1u << 5)
e354a5
+#define bit_cpu_HRESET		(1u << 22)
e354a5
 
e354a5
 /* COMMON_CPUID_INDEX_19.  */
e354a5
 
e354a5
@@ -533,6 +534,7 @@ extern const struct cpu_features *__x86_get_cpu_features (unsigned int)
e354a5
 /* EAX.  */
e354a5
 #define index_cpu_AVX_VNNI	COMMON_CPUID_INDEX_7_ECX_1
e354a5
 #define index_cpu_AVX512_BF16	COMMON_CPUID_INDEX_7_ECX_1
e354a5
+#define index_cpu_HRESET	COMMON_CPUID_INDEX_7_ECX_1
e354a5
 
e354a5
 /* COMMON_CPUID_INDEX_19.  */
e354a5
 
e354a5
@@ -753,6 +755,7 @@ extern const struct cpu_features *__x86_get_cpu_features (unsigned int)
e354a5
 /* EAX.  */
e354a5
 #define reg_AVX_VNNI		eax
e354a5
 #define reg_AVX512_BF16		eax
e354a5
+#define reg_HRESET		eax
e354a5
 
e354a5
 /* COMMON_CPUID_INDEX_19.  */
e354a5
 
e354a5
diff --git a/sysdeps/x86/tst-get-cpu-features.c b/sysdeps/x86/tst-get-cpu-features.c
e354a5
index 8894d9f08ac36633..1516af1d461a801b 100644
e354a5
--- a/sysdeps/x86/tst-get-cpu-features.c
e354a5
+++ b/sysdeps/x86/tst-get-cpu-features.c
e354a5
@@ -221,6 +221,7 @@ do_test (void)
e354a5
   CHECK_CPU_FEATURE (WBNOINVD);
e354a5
   CHECK_CPU_FEATURE (AVX_VNNI);
e354a5
   CHECK_CPU_FEATURE (AVX512_BF16);
e354a5
+  CHECK_CPU_FEATURE (HRESET);
e354a5
   CHECK_CPU_FEATURE (AESKLE);
e354a5
   CHECK_CPU_FEATURE (WIDE_KL);
e354a5