9ae3a8
From 3aa3deed539cd90a2eee32d3d8c2f673adb58aa8 Mon Sep 17 00:00:00 2001
9ae3a8
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
9ae3a8
Date: Wed, 9 May 2018 09:06:29 +0100
9ae3a8
Subject: [PATCH 03/10] i386: define the 'ssbd' CPUID feature bit
9ae3a8
 (CVE-2018-3639)
9ae3a8
MIME-Version: 1.0
9ae3a8
Content-Type: text/plain; charset=UTF-8
9ae3a8
Content-Transfer-Encoding: 8bit
9ae3a8
9ae3a8
RH-Author: Daniel P. Berrangé <berrange@redhat.com>
9ae3a8
Bugzilla: 1574082
9ae3a8
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
9ae3a8
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
9ae3a8
New microcode introduces the "Speculative Store Bypass Disable"
9ae3a8
CPUID feature bit. This needs to be exposed to guest OS to allow
9ae3a8
them to protect against CVE-2018-3639.
9ae3a8
9ae3a8
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
9ae3a8
---
9ae3a8
 target-i386/cpu.c | 2 +-
9ae3a8
 target-i386/cpu.h | 1 +
9ae3a8
 2 files changed, 2 insertions(+), 1 deletion(-)
9ae3a8
9ae3a8
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
9ae3a8
index 08b43f5..539c202 100644
9ae3a8
--- a/target-i386/cpu.c
9ae3a8
+++ b/target-i386/cpu.c
9ae3a8
@@ -173,7 +173,7 @@ static const char *cpuid_7_0_edx_feature_name[] = {
9ae3a8
     NULL, NULL, NULL, NULL,
9ae3a8
     NULL, NULL, NULL, NULL,
9ae3a8
     NULL, NULL, "spec-ctrl", "stibp",
9ae3a8
-    NULL, "arch-facilities", NULL, NULL,
9ae3a8
+    NULL, "arch-facilities", NULL, "ssbd",
9ae3a8
 };
9ae3a8
 
9ae3a8
 static const char *cpuid_80000008_ebx_feature_name[] = {
9ae3a8
diff --git a/target-i386/cpu.h b/target-i386/cpu.h
9ae3a8
index a8a640a..da84443 100644
9ae3a8
--- a/target-i386/cpu.h
9ae3a8
+++ b/target-i386/cpu.h
9ae3a8
@@ -590,6 +590,7 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS];
9ae3a8
 #define CPUID_7_0_EDX_AVX512_4VNNIW (1U << 2) /* AVX512 Neural Network Instructions */
9ae3a8
 #define CPUID_7_0_EDX_AVX512_4FMAPS (1U << 3) /* AVX512 Multiply Accumulation Single Precision */
9ae3a8
 #define CPUID_7_0_EDX_SPEC_CTRL     (1U << 26) /* Indirect Branch - Restrict Speculation */
9ae3a8
+#define CPUID_7_0_EDX_SPEC_CTRL_SSBD  (1U << 31) /* Speculative Store Bypass Disable */
9ae3a8
 
9ae3a8
 #define CPUID_8000_0008_EBX_IBPB    (1U << 12) /* Indirect Branch Prediction Barrier */
9ae3a8
 
9ae3a8
-- 
9ae3a8
1.8.3.1
9ae3a8