Blame SOURCES/kvm-i386-define-the-ssbd-CPUID-feature-bit-CVE-2018-3639.patch

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