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