yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

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

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