51d9a2
From 5d335dc7f64e2bd394c1bf86c6e5582fd859857a Mon Sep 17 00:00:00 2001
51d9a2
Message-Id: <5d335dc7f64e2bd394c1bf86c6e5582fd859857a@dist-git>
51d9a2
From: Paolo Bonzini <pbonzini@redhat.com>
51d9a2
Date: Tue, 12 Dec 2017 16:23:42 +0100
51d9a2
Subject: [PATCH] RHEL: cpu: Add downstream only CPU features for CVE-2017-5715
51d9a2
51d9a2
RHEL-only: The downstream patches for CVE-2017-5715 contained more CPU
51d9a2
features than what was eventually pushed upstream. We need to keep them
51d9a2
included for backward compatibility.
51d9a2
51d9a2
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
51d9a2
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
51d9a2
---
51d9a2
 src/cpu/cpu_map.xml                                         | 6 ++++++
51d9a2
 .../x86_64-cpuid-Core-i7-5600U-ibrs-disabled.xml            | 2 +-
51d9a2
 tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-guest.xml | 1 +
51d9a2
 tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-host.xml  | 1 +
51d9a2
 tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-disabled.xml | 2 +-
51d9a2
 tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-guest.xml    | 1 +
51d9a2
 tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-host.xml     | 1 +
51d9a2
 tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-disabled.xml | 2 +-
51d9a2
 tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-guest.xml    | 1 +
51d9a2
 tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-host.xml     | 1 +
51d9a2
 tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-disabled.xml  | 2 +-
51d9a2
 tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-guest.xml     | 1 +
51d9a2
 tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-host.xml      | 1 +
51d9a2
 13 files changed, 18 insertions(+), 4 deletions(-)
51d9a2
51d9a2
diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml
51d9a2
index 96daa0f9af..f1f8048c14 100644
51d9a2
--- a/src/cpu/cpu_map.xml
51d9a2
+++ b/src/cpu/cpu_map.xml
51d9a2
@@ -298,6 +298,12 @@
51d9a2
     <feature name='spec-ctrl'>
51d9a2
       <cpuid eax_in='0x07' ecx_in='0x00' edx='0x04000000'/>
51d9a2
     </feature>
51d9a2
+    <feature name='stibp'>
51d9a2
+      <cpuid eax_in='0x07' ecx_in='0x00' edx='0x08000000'/>
51d9a2
+    </feature>
51d9a2
+    <feature name='arch-facilities'>
51d9a2
+      <cpuid eax_in='0x07' ecx_in='0x00' edx='0x20000000'/>
51d9a2
+    </feature>
51d9a2
     <feature name='ssbd'>
51d9a2
       <cpuid eax_in='0x07' ecx_in='0x00' edx='0x80000000'/>
51d9a2
     </feature>
51d9a2
diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-disabled.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-disabled.xml
51d9a2
index e033bb141f..5c9cfa9bd6 100644
51d9a2
--- a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-disabled.xml
51d9a2
+++ b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-disabled.xml
51d9a2
@@ -1,6 +1,6 @@
51d9a2
 
51d9a2
 <cpudata arch='x86'>
51d9a2
   <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0800c1dc' edx='0xb0600000'/>
51d9a2
-  <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x04000000'/>
51d9a2
+  <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x0c000000'/>
51d9a2
   <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/>
51d9a2
 </cpudata>
51d9a2
diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-guest.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-guest.xml
51d9a2
index a70cb6d46a..538bfe16ab 100644
51d9a2
--- a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-guest.xml
51d9a2
+++ b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-guest.xml
51d9a2
@@ -22,6 +22,7 @@
51d9a2
   <feature policy='require' name='rdrand'/>
51d9a2
   <feature policy='require' name='arat'/>
51d9a2
   <feature policy='require' name='tsc_adjust'/>
51d9a2
+  <feature policy='require' name='stibp'/>
51d9a2
   <feature policy='require' name='xsaveopt'/>
51d9a2
   <feature policy='require' name='pdpe1gb'/>
51d9a2
   <feature policy='require' name='abm'/>
51d9a2
diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-host.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-host.xml
51d9a2
index b8e3399103..004423ee57 100644
51d9a2
--- a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-host.xml
51d9a2
+++ b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-host.xml
51d9a2
@@ -23,6 +23,7 @@
51d9a2
   <feature name='rdrand'/>
51d9a2
   <feature name='arat'/>
51d9a2
   <feature name='tsc_adjust'/>
51d9a2
+  <feature name='stibp'/>
51d9a2
   <feature name='xsaveopt'/>
51d9a2
   <feature name='pdpe1gb'/>
51d9a2
   <feature name='abm'/>
51d9a2
diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-disabled.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-disabled.xml
51d9a2
index aacc7a2b14..ec299652f7 100644
51d9a2
--- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-disabled.xml
51d9a2
+++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-disabled.xml
51d9a2
@@ -1,6 +1,6 @@
51d9a2
 
51d9a2
 <cpudata arch='x86'>
51d9a2
   <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0804c1fc' edx='0xb0600000'/>
51d9a2
-  <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00001000' ecx='0x00000000' edx='0x00000000'/>
51d9a2
+  <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00001000' ecx='0x00000000' edx='0x08000000'/>
51d9a2
   <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/>
51d9a2
 </cpudata>
51d9a2
diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-guest.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-guest.xml
51d9a2
index a66c7a5644..d8aaaad29d 100644
51d9a2
--- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-guest.xml
51d9a2
+++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-guest.xml
51d9a2
@@ -24,6 +24,7 @@
51d9a2
   <feature policy='require' name='arat'/>
51d9a2
   <feature policy='require' name='tsc_adjust'/>
51d9a2
   <feature policy='require' name='cmt'/>
51d9a2
+  <feature policy='require' name='stibp'/>
51d9a2
   <feature policy='require' name='xsaveopt'/>
51d9a2
   <feature policy='require' name='pdpe1gb'/>
51d9a2
   <feature policy='require' name='abm'/>
51d9a2
diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-host.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-host.xml
51d9a2
index 624d71db20..9bac4b4648 100644
51d9a2
--- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-host.xml
51d9a2
+++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-host.xml
51d9a2
@@ -25,6 +25,7 @@
51d9a2
   <feature name='arat'/>
51d9a2
   <feature name='tsc_adjust'/>
51d9a2
   <feature name='cmt'/>
51d9a2
+  <feature name='stibp'/>
51d9a2
   <feature name='xsaveopt'/>
51d9a2
   <feature name='pdpe1gb'/>
51d9a2
   <feature name='abm'/>
51d9a2
diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-disabled.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-disabled.xml
51d9a2
index d904808cec..85369d755c 100644
51d9a2
--- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-disabled.xml
51d9a2
+++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-disabled.xml
51d9a2
@@ -1,7 +1,7 @@
51d9a2
 
51d9a2
 <cpudata arch='x86'>
51d9a2
   <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0804c1fc' edx='0xb0600000'/>
51d9a2
-  <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00001000' ecx='0x00000000' edx='0x00000000'/>
51d9a2
+  <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00001000' ecx='0x00000000' edx='0x08000000'/>
51d9a2
   <cpuid eax_in='0x0000000f' ecx_in='0x01' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000006'/>
51d9a2
   <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/>
51d9a2
 </cpudata>
51d9a2
diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-guest.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-guest.xml
51d9a2
index 60609f5c70..d4f303ecce 100644
51d9a2
--- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-guest.xml
51d9a2
+++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-guest.xml
51d9a2
@@ -20,6 +20,7 @@
51d9a2
   <feature policy='require' name='osxsave'/>
51d9a2
   <feature policy='require' name='tsc_adjust'/>
51d9a2
   <feature policy='require' name='cmt'/>
51d9a2
+  <feature policy='require' name='stibp'/>
51d9a2
   <feature policy='require' name='mbm_total'/>
51d9a2
   <feature policy='require' name='mbm_local'/>
51d9a2
   <feature policy='require' name='pdpe1gb'/>
51d9a2
diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-host.xml b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-host.xml
51d9a2
index 357cafd10a..60a7a9339d 100644
51d9a2
--- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-host.xml
51d9a2
+++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-host.xml
51d9a2
@@ -25,6 +25,7 @@
51d9a2
   <feature name='arat'/>
51d9a2
   <feature name='tsc_adjust'/>
51d9a2
   <feature name='cmt'/>
51d9a2
+  <feature name='stibp'/>
51d9a2
   <feature name='xsaveopt'/>
51d9a2
   <feature name='mbm_total'/>
51d9a2
   <feature name='mbm_local'/>
51d9a2
diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-disabled.xml b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-disabled.xml
51d9a2
index b5c70a9dc4..a5b85a15c2 100644
51d9a2
--- a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-disabled.xml
51d9a2
+++ b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-disabled.xml
51d9a2
@@ -1,7 +1,7 @@
51d9a2
 
51d9a2
 <cpudata arch='x86'>
51d9a2
   <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0804c1fc' edx='0xb0600000'/>
51d9a2
-  <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00001000' ecx='0x00000008' edx='0x00000000'/>
51d9a2
+  <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00001000' ecx='0x00000008' edx='0x08000000'/>
51d9a2
   <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/>
51d9a2
   <cpuid eax_in='0x0000000f' ecx_in='0x01' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000006'/>
51d9a2
   <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/>
51d9a2
diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-guest.xml b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-guest.xml
51d9a2
index 5f51dea631..64b69dea56 100644
51d9a2
--- a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-guest.xml
51d9a2
+++ b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-guest.xml
51d9a2
@@ -22,6 +22,7 @@
51d9a2
   <feature policy='require' name='cmt'/>
51d9a2
   <feature policy='require' name='clflushopt'/>
51d9a2
   <feature policy='require' name='pku'/>
51d9a2
+  <feature policy='require' name='stibp'/>
51d9a2
   <feature policy='require' name='xsaves'/>
51d9a2
   <feature policy='require' name='mbm_total'/>
51d9a2
   <feature policy='require' name='mbm_local'/>
51d9a2
diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-host.xml b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-host.xml
51d9a2
index a11b31369d..00e8da7512 100644
51d9a2
--- a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-host.xml
51d9a2
+++ b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-host.xml
51d9a2
@@ -23,6 +23,7 @@
51d9a2
   <feature name='cmt'/>
51d9a2
   <feature name='clflushopt'/>
51d9a2
   <feature name='pku'/>
51d9a2
+  <feature name='stibp'/>
51d9a2
   <feature name='xsaves'/>
51d9a2
   <feature name='mbm_total'/>
51d9a2
   <feature name='mbm_local'/>
51d9a2
-- 
51d9a2
2.18.0
51d9a2