d65131
From: Eduardo Habkost <ehabkost@redhat.com>
d65131
Date: Tue, 9 Jan 2018 13:45:15 -0200
a056f3
Subject: [PATCH] i386: Add spec-ctrl CPUID bit
d65131
d65131
Add the feature name and a CPUID_7_0_EDX_SPEC_CTRL macro.
d65131
d65131
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
d65131
Message-Id: <20180109154519.25634-4-ehabkost@redhat.com>
d65131
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
d65131
(cherry picked from commit a2381f0934432ef2cd47a335348ba8839632164c)
d65131
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
d65131
(cherry picked from commit 803d42fa65a371f7bb13180a5953299dc3a160e0)
d65131
---
d65131
 target/i386/cpu.c | 2 +-
d65131
 target/i386/cpu.h | 1 +
d65131
 2 files changed, 2 insertions(+), 1 deletion(-)
d65131
d65131
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
d65131
index a861518790..1ec1beec7a 100644
d65131
--- a/target/i386/cpu.c
d65131
+++ b/target/i386/cpu.c
d65131
@@ -456,7 +456,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
d65131
             NULL, NULL, NULL, NULL,
d65131
             NULL, NULL, NULL, NULL,
d65131
             NULL, NULL, NULL, NULL,
d65131
-            NULL, NULL, NULL, NULL,
d65131
+            NULL, NULL, "spec-ctrl", NULL,
d65131
             NULL, NULL, NULL, NULL,
d65131
         },
d65131
         .cpuid_eax = 7,
d65131
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
d65131
index 58c975beec..84698f5b62 100644
d65131
--- a/target/i386/cpu.h
d65131
+++ b/target/i386/cpu.h
d65131
@@ -642,6 +642,7 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS];
d65131
 
d65131
 #define CPUID_7_0_EDX_AVX512_4VNNIW (1U << 2) /* AVX512 Neural Network Instructions */
d65131
 #define CPUID_7_0_EDX_AVX512_4FMAPS (1U << 3) /* AVX512 Multiply Accumulation Single Precision */
d65131
+#define CPUID_7_0_EDX_SPEC_CTRL     (1U << 26) /* Speculation Control */
d65131
 
d65131
 #define CPUID_XSAVE_XSAVEOPT   (1U << 0)
d65131
 #define CPUID_XSAVE_XSAVEC     (1U << 1)