edecca
From 41a79702b10fc039aa76524626b77f91dc01edbd Mon Sep 17 00:00:00 2001
edecca
Message-Id: <41a79702b10fc039aa76524626b77f91dc01edbd@dist-git>
edecca
From: Jiri Denemark <jdenemar@redhat.com>
edecca
Date: Mon, 17 Dec 2018 16:24:32 +0100
edecca
Subject: [PATCH] cpu: Add support for "stibp" x86_64 feature
edecca
MIME-Version: 1.0
edecca
Content-Type: text/plain; charset=UTF-8
edecca
Content-Transfer-Encoding: 8bit
edecca
edecca
QEMU commit v3.1.0-4-g0e89165829
edecca
KVM patch: https://lore.kernel.org/lkml/20181205191956.31480-1-ehabkost@redhat.com/
edecca
edecca
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
edecca
Reviewed-by: Ján Tomko <jtomko@redhat.com>
edecca
(cherry picked from commit eb1b551d21e316c1e80aba0b2af6969fdd849f0c)
edecca
edecca
Conflicts:
edecca
	src/cpu_map/x86_features.xml
edecca
            - cpu_map.xml is still monolithic in RHEL-8
edecca
edecca
https://bugzilla.redhat.com/show_bug.cgi?id=1655032
edecca
edecca
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
edecca
---
edecca
 src/cpu/cpu_map.xml                                            | 3 +++
edecca
 tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-disabled.xml | 2 +-
edecca
 tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-guest.xml    | 1 +
edecca
 tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-host.xml     | 1 +
edecca
 tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-disabled.xml    | 2 +-
edecca
 tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-guest.xml       | 1 +
edecca
 tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-host.xml        | 1 +
edecca
 tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-disabled.xml    | 2 +-
edecca
 tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-guest.xml       | 1 +
edecca
 tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-host.xml        | 1 +
edecca
 tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-disabled.xml     | 2 +-
edecca
 tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-guest.xml        | 1 +
edecca
 tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-host.xml         | 1 +
edecca
 13 files changed, 15 insertions(+), 4 deletions(-)
edecca
edecca
diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml
edecca
index cdb023e936..095d49a69a 100644
edecca
--- a/src/cpu/cpu_map.xml
edecca
+++ b/src/cpu/cpu_map.xml
edecca
@@ -328,6 +328,9 @@
edecca
     <feature name='spec-ctrl'>
edecca
       <cpuid eax_in='0x07' ecx_in='0x00' edx='0x04000000'/>
edecca
     </feature>
edecca
+    <feature name='stibp'>
edecca
+      <cpuid eax_in='0x07' ecx_in='0x00' edx='0x08000000'/>
edecca
+    </feature>
edecca
     <feature name='ssbd'>
edecca
       <cpuid eax_in='0x07' ecx_in='0x00' edx='0x80000000'/>
edecca
     </feature>
edecca
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
edecca
index e033bb141f..5c9cfa9bd6 100644
edecca
--- a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-disabled.xml
edecca
+++ b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-disabled.xml
edecca
@@ -1,6 +1,6 @@
edecca
 
edecca
 <cpudata arch='x86'>
edecca
   <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0800c1dc' edx='0xb0600000'/>
edecca
-  <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x04000000'/>
edecca
+  <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x0c000000'/>
edecca
   <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/>
edecca
 </cpudata>
edecca
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
edecca
index 4fa4770208..5d3093cec1 100644
edecca
--- a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-guest.xml
edecca
+++ b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-guest.xml
edecca
@@ -23,6 +23,7 @@
edecca
   <feature policy='require' name='arat'/>
edecca
   <feature policy='require' name='tsc_adjust'/>
edecca
   <feature policy='require' name='intel-pt'/>
edecca
+  <feature policy='require' name='stibp'/>
edecca
   <feature policy='require' name='xsaveopt'/>
edecca
   <feature policy='require' name='pdpe1gb'/>
edecca
   <feature policy='require' name='abm'/>
edecca
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
edecca
index 25690c099c..a534d2dec5 100644
edecca
--- a/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-host.xml
edecca
+++ b/tests/cputestdata/x86_64-cpuid-Core-i7-5600U-ibrs-host.xml
edecca
@@ -24,6 +24,7 @@
edecca
   <feature name='arat'/>
edecca
   <feature name='tsc_adjust'/>
edecca
   <feature name='intel-pt'/>
edecca
+  <feature name='stibp'/>
edecca
   <feature name='xsaveopt'/>
edecca
   <feature name='pdpe1gb'/>
edecca
   <feature name='abm'/>
edecca
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
edecca
index aacc7a2b14..ec299652f7 100644
edecca
--- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-disabled.xml
edecca
+++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-disabled.xml
edecca
@@ -1,6 +1,6 @@
edecca
 
edecca
 <cpudata arch='x86'>
edecca
   <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0804c1fc' edx='0xb0600000'/>
edecca
-  <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00001000' ecx='0x00000000' edx='0x00000000'/>
edecca
+  <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00001000' ecx='0x00000000' edx='0x08000000'/>
edecca
   <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/>
edecca
 </cpudata>
edecca
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
edecca
index a66c7a5644..d8aaaad29d 100644
edecca
--- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-guest.xml
edecca
+++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-guest.xml
edecca
@@ -24,6 +24,7 @@
edecca
   <feature policy='require' name='arat'/>
edecca
   <feature policy='require' name='tsc_adjust'/>
edecca
   <feature policy='require' name='cmt'/>
edecca
+  <feature policy='require' name='stibp'/>
edecca
   <feature policy='require' name='xsaveopt'/>
edecca
   <feature policy='require' name='pdpe1gb'/>
edecca
   <feature policy='require' name='abm'/>
edecca
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
edecca
index 624d71db20..9bac4b4648 100644
edecca
--- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-host.xml
edecca
+++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2609-v3-host.xml
edecca
@@ -25,6 +25,7 @@
edecca
   <feature name='arat'/>
edecca
   <feature name='tsc_adjust'/>
edecca
   <feature name='cmt'/>
edecca
+  <feature name='stibp'/>
edecca
   <feature name='xsaveopt'/>
edecca
   <feature name='pdpe1gb'/>
edecca
   <feature name='abm'/>
edecca
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
edecca
index d904808cec..85369d755c 100644
edecca
--- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-disabled.xml
edecca
+++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-disabled.xml
edecca
@@ -1,7 +1,7 @@
edecca
 
edecca
 <cpudata arch='x86'>
edecca
   <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0804c1fc' edx='0xb0600000'/>
edecca
-  <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00001000' ecx='0x00000000' edx='0x00000000'/>
edecca
+  <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00001000' ecx='0x00000000' edx='0x08000000'/>
edecca
   <cpuid eax_in='0x0000000f' ecx_in='0x01' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000006'/>
edecca
   <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/>
edecca
 </cpudata>
edecca
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
edecca
index 7b93df3f1b..7718d7ca59 100644
edecca
--- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-guest.xml
edecca
+++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-guest.xml
edecca
@@ -21,6 +21,7 @@
edecca
   <feature policy='require' name='tsc_adjust'/>
edecca
   <feature policy='require' name='cmt'/>
edecca
   <feature policy='require' name='intel-pt'/>
edecca
+  <feature policy='require' name='stibp'/>
edecca
   <feature policy='require' name='mbm_total'/>
edecca
   <feature policy='require' name='mbm_local'/>
edecca
   <feature policy='require' name='pdpe1gb'/>
edecca
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
edecca
index 5078420c7a..43a0b93ab4 100644
edecca
--- a/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-host.xml
edecca
+++ b/tests/cputestdata/x86_64-cpuid-Xeon-E5-2623-v4-host.xml
edecca
@@ -26,6 +26,7 @@
edecca
   <feature name='tsc_adjust'/>
edecca
   <feature name='cmt'/>
edecca
   <feature name='intel-pt'/>
edecca
+  <feature name='stibp'/>
edecca
   <feature name='xsaveopt'/>
edecca
   <feature name='mbm_total'/>
edecca
   <feature name='mbm_local'/>
edecca
diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-disabled.xml b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-disabled.xml
edecca
index b5c70a9dc4..a5b85a15c2 100644
edecca
--- a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-disabled.xml
edecca
+++ b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-disabled.xml
edecca
@@ -1,7 +1,7 @@
edecca
 
edecca
 <cpudata arch='x86'>
edecca
   <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x0804c1fc' edx='0xb0600000'/>
edecca
-  <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00001000' ecx='0x00000008' edx='0x00000000'/>
edecca
+  <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x00001000' ecx='0x00000008' edx='0x08000000'/>
edecca
   <cpuid eax_in='0x0000000d' ecx_in='0x01' eax='0x00000008' ebx='0x00000000' ecx='0x00000000' edx='0x00000000'/>
edecca
   <cpuid eax_in='0x0000000f' ecx_in='0x01' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000006'/>
edecca
   <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/>
edecca
diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-guest.xml b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-guest.xml
edecca
index 480127f341..8f014f6e28 100644
edecca
--- a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-guest.xml
edecca
+++ b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-guest.xml
edecca
@@ -23,6 +23,7 @@
edecca
   <feature policy='require' name='clflushopt'/>
edecca
   <feature policy='require' name='intel-pt'/>
edecca
   <feature policy='require' name='pku'/>
edecca
+  <feature policy='require' name='stibp'/>
edecca
   <feature policy='require' name='xsaves'/>
edecca
   <feature policy='require' name='mbm_total'/>
edecca
   <feature policy='require' name='mbm_local'/>
edecca
diff --git a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-host.xml b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-host.xml
edecca
index 680b10acef..9de76fd640 100644
edecca
--- a/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-host.xml
edecca
+++ b/tests/cputestdata/x86_64-cpuid-Xeon-Gold-5115-host.xml
edecca
@@ -24,6 +24,7 @@
edecca
   <feature name='clflushopt'/>
edecca
   <feature name='intel-pt'/>
edecca
   <feature name='pku'/>
edecca
+  <feature name='stibp'/>
edecca
   <feature name='xsaves'/>
edecca
   <feature name='mbm_total'/>
edecca
   <feature name='mbm_local'/>
edecca
-- 
edecca
2.20.1
edecca