4e77bf
From 6fff75c304d9403ac7c36c436ddf53497f6417ef Mon Sep 17 00:00:00 2001
4e77bf
Message-Id: <6fff75c304d9403ac7c36c436ddf53497f6417ef@dist-git>
4e77bf
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
4e77bf
Date: Mon, 21 May 2018 23:05:08 +0100
4e77bf
Subject: [PATCH] cpu: define the 'virt-ssbd' CPUID feature bit (CVE-2018-3639)
4e77bf
MIME-Version: 1.0
4e77bf
Content-Type: text/plain; charset=UTF-8
4e77bf
Content-Transfer-Encoding: 8bit
4e77bf
4e77bf
Some AMD processors only support a non-architectural means of
4e77bf
enabling Speculative Store Bypass Disable. To allow simplified
4e77bf
handling in virtual environments, hypervisors will expose an
4e77bf
architectural definition through CPUID bit 0x80000008_EBX[25].
4e77bf
This needs to be exposed to guest OS running on AMD x86 hosts to
4e77bf
allow them to protect against CVE-2018-3639.
4e77bf
4e77bf
Note that since this CPUID bit won't be present in the host CPUID
4e77bf
results on physical hosts, it will not be enabled automatically
4e77bf
in guests configured with "host-model" CPU unless using QEMU
4e77bf
version >= 2.9.0. Thus for older versions of QEMU, this feature
4e77bf
must be manually enabled using policy=force. Guests using the
4e77bf
"host-passthrough" CPU mode do not need special handling.
4e77bf
4e77bf
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4e77bf
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
4e77bf
(cherry picked from commit 9267342206ce17f6933d57a3128cdc504d5945c9)
4e77bf
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
4e77bf
Reviewed-by: Erik Skultety <eskultet@redhat.com>
4e77bf
---
4e77bf
 src/cpu/cpu_map.xml | 3 +++
4e77bf
 1 file changed, 3 insertions(+)
4e77bf
4e77bf
diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml
4e77bf
index cee3541d24..e0c39bb690 100644
4e77bf
--- a/src/cpu/cpu_map.xml
4e77bf
+++ b/src/cpu/cpu_map.xml
4e77bf
@@ -436,6 +436,9 @@
4e77bf
     <feature name='ibpb'>
4e77bf
       <cpuid eax_in='0x80000008' ebx='0x00001000'/>
4e77bf
     </feature>
4e77bf
+    <feature name='virt-ssbd'>
4e77bf
+      <cpuid eax_in='0x80000008' ebx='0x02000000'/>
4e77bf
+    </feature>
4e77bf
 
4e77bf
     
4e77bf
     <model name='486'>
4e77bf
-- 
4e77bf
2.17.1
4e77bf