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