thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

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

169b9a
From 3aa3deed539cd90a2eee32d3d8c2f673adb58aa8 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
169b9a
Subject: [PATCH 03/10] i386: define the 'ssbd' CPUID feature bit
169b9a
 (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>
169b9a
Bugzilla: 1574082
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