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

ae23c9
From 8c311241e277756db896fdab983c6250ffde5fc0 Mon Sep 17 00:00:00 2001
ae23c9
From: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
Date: Sat, 13 Oct 2018 03:32:30 +0100
ae23c9
Subject: [PATCH 17/17] i386: define the 'ssbd' CPUID feature bit
ae23c9
 (CVE-2018-3639)
ae23c9
MIME-Version: 1.0
ae23c9
Content-Type: text/plain; charset=UTF-8
ae23c9
Content-Transfer-Encoding: 8bit
ae23c9
ae23c9
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
Message-id: <20181013033230.14687-2-ehabkost@redhat.com>
ae23c9
Patchwork-id: 82685
ae23c9
O-Subject: [RHEL8/rhel qemu-kvm PATCH 1/1] i386: define the 'ssbd' CPUID feature bit (CVE-2018-3639)
ae23c9
Bugzilla: 1633928
ae23c9
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
ae23c9
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
ae23c9
RH-Acked-by: Daniel P. Berrange <berrange@redhat.com>
ae23c9
ae23c9
From: Daniel P. Berrangé <berrange@redhat.com>
ae23c9
ae23c9
New microcode introduces the "Speculative Store Bypass Disable"
ae23c9
CPUID feature bit. This needs to be exposed to guest OS to allow
ae23c9
them to protect against CVE-2018-3639.
ae23c9
ae23c9
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
ae23c9
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
ae23c9
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
ae23c9
Message-Id: <20180521215424.13520-2-berrange@redhat.com>
ae23c9
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
(cherry picked from commit d19d1f965904a533998739698020ff4ee8a103da)
ae23c9
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
ae23c9
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ae23c9
---
ae23c9
 target/i386/cpu.c | 2 +-
ae23c9
 target/i386/cpu.h | 1 +
ae23c9
 2 files changed, 2 insertions(+), 1 deletion(-)
ae23c9
ae23c9
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
ae23c9
index 0215b20..228935f 100644
ae23c9
--- a/target/i386/cpu.c
ae23c9
+++ b/target/i386/cpu.c
ae23c9
@@ -1008,7 +1008,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
ae23c9
             NULL, NULL, NULL, NULL,
ae23c9
             NULL, NULL, NULL, NULL,
ae23c9
             NULL, NULL, "spec-ctrl", NULL,
ae23c9
-            NULL, NULL, NULL, NULL,
ae23c9
+            NULL, NULL, NULL, "ssbd",
ae23c9
         },
ae23c9
         .cpuid_eax = 7,
ae23c9
         .cpuid_needs_ecx = true, .cpuid_ecx = 0,
ae23c9
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
ae23c9
index c47db96..4a3ef4b 100644
ae23c9
--- a/target/i386/cpu.h
ae23c9
+++ b/target/i386/cpu.h
ae23c9
@@ -685,6 +685,7 @@ typedef uint32_t FeatureWordArray[FEATURE_WORDS];
ae23c9
 #define CPUID_7_0_EDX_AVX512_4VNNIW (1U << 2) /* AVX512 Neural Network Instructions */
ae23c9
 #define CPUID_7_0_EDX_AVX512_4FMAPS (1U << 3) /* AVX512 Multiply Accumulation Single Precision */
ae23c9
 #define CPUID_7_0_EDX_SPEC_CTRL     (1U << 26) /* Speculation Control */
ae23c9
+#define CPUID_7_0_EDX_SPEC_CTRL_SSBD  (1U << 31) /* Speculative Store Bypass Disable */
ae23c9
 
ae23c9
 #define KVM_HINTS_DEDICATED (1U << 0)
ae23c9
 
ae23c9
-- 
ae23c9
1.8.3.1
ae23c9