Blob Blame History Raw
From b3505e6f099cf4af35e254e077bb61cf62f035ed Mon Sep 17 00:00:00 2001
Message-Id: <b3505e6f099cf4af35e254e077bb61cf62f035ed@dist-git>
From: Paolo Bonzini <pbonzini@redhat.com>
Date: Tue, 12 Dec 2017 16:23:42 +0100
Subject: [PATCH] cpu: add CPU features and model for indirect branch
 prediction protection

CVE-2017-5715

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>

Conflicts:
	src/cpu/cpu_map.xml
            - no Skylake-Server and EPYC CPU models
---
 src/cpu/cpu_map.xml | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml
index 29b5b596f4..7fbba9f0d8 100644
--- a/src/cpu/cpu_map.xml
+++ b/src/cpu/cpu_map.xml
@@ -283,6 +283,15 @@
     <feature name='avx512-4fmaps'>
       <cpuid eax_in='0x07' edx='0x00000008'/>
     </feature>
+    <feature name='spec-ctrl'>
+      <cpuid eax_in='0x07' ecx_in='0x00' edx='0x04000000'/>
+    </feature>
+    <feature name='stibp'>
+      <cpuid eax_in='0x07' ecx_in='0x00' edx='0x08000000'/>
+    </feature>
+    <feature name='arch-facilities'>
+      <cpuid eax_in='0x07' ecx_in='0x00' edx='0x20000000'/>
+    </feature>
 
     <!-- Processor Extended State Enumeration sub leaf 1 -->
     <feature name='xsaveopt'>
@@ -411,6 +420,11 @@
       <cpuid eax_in='0x80000007' edx='0x00000100'/>
     </feature>
 
+    <!-- More AMD-specific features -->
+    <feature name='ibpb'>
+      <cpuid eax_in='0x80000008' ebx='0x00001000'/>
+    </feature>
+
     <!-- models -->
     <model name='486'>
       <feature name='fpu'/>
@@ -857,6 +871,10 @@
       <feature name='syscall'/>
       <feature name='tsc'/>
     </model>
+    <model name='Nehalem-IBRS'>
+      <model name='Nehalem'/>
+      <feature name='spec-ctrl'/>
+    </model>
 
     <model name='Westmere'>
       <signature family='6' model='44'/>
@@ -894,6 +912,10 @@
       <feature name='syscall'/>
       <feature name='tsc'/>
     </model>
+    <model name='Westmere-IBRS'>
+      <model name='Westmere'/>
+      <feature name='spec-ctrl'/>
+    </model>
 
     <model name='SandyBridge'>
       <signature family='6' model='42'/>
@@ -937,6 +959,10 @@
       <feature name='x2apic'/>
       <feature name='xsave'/>
     </model>
+    <model name='SandyBridge-IBRS'>
+      <model name='SandyBridge'/>
+      <feature name='spec-ctrl'/>
+    </model>
 
     <model name='IvyBridge'>
       <signature family='6' model='58'/>
@@ -986,6 +1012,10 @@
       <feature name='x2apic'/>
       <feature name='xsave'/>
     </model>
+    <model name='IvyBridge-IBRS'>
+      <model name='IvyBridge'/>
+      <feature name='spec-ctrl'/>
+    </model>
 
     <model name='Haswell-noTSX'>
       <signature family='6' model='60'/>
@@ -1039,6 +1069,10 @@
       <feature name='x2apic'/>
       <feature name='xsave'/>
     </model>
+    <model name='Haswell-noTSX-IBRS'>
+      <model name='Haswell-noTSX'/>
+      <feature name='spec-ctrl'/>
+    </model>
 
     <model name='Haswell'>
       <signature family='6' model='60'/>
@@ -1094,6 +1128,10 @@
       <feature name='x2apic'/>
       <feature name='xsave'/>
     </model>
+    <model name='Haswell-IBRS'>
+      <model name='Haswell'/>
+      <feature name='spec-ctrl'/>
+    </model>
 
     <model name='Broadwell-noTSX'>
       <signature family='6' model='61'/>
@@ -1151,6 +1189,10 @@
       <feature name='x2apic'/>
       <feature name='xsave'/>
     </model>
+    <model name='Broadwell-noTSX-IBRS'>
+      <model name='Broadwell-noTSX'/>
+      <feature name='spec-ctrl'/>
+    </model>
 
     <model name='Broadwell'>
       <signature family='6' model='61'/>
@@ -1210,6 +1252,10 @@
       <feature name='x2apic'/>
       <feature name='xsave'/>
     </model>
+    <model name='Broadwell-IBRS'>
+      <model name='Broadwell'/>
+      <feature name='spec-ctrl'/>
+    </model>
 
     <model name='Skylake-Client'>
       <signature family='6' model='94'/>
@@ -1278,6 +1324,10 @@
       <feature name='xsavec'/>
       <feature name='xsaveopt'/>
     </model>
+    <model name='Skylake-Client-IBRS'>
+      <model name='Skylake-Client'/>
+      <feature name='spec-ctrl'/>
+    </model>
 
     <!-- AMD CPUs -->
     <model name='athlon'>
-- 
2.15.1