render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
a41c76
From 2268a9862c16c87007bfbae117d345268f8420e4 Mon Sep 17 00:00:00 2001
a41c76
Message-Id: <2268a9862c16c87007bfbae117d345268f8420e4@dist-git>
a41c76
From: Jiri Denemark <jdenemar@redhat.com>
a41c76
Date: Tue, 26 May 2020 10:58:58 +0200
a41c76
Subject: [PATCH] cpu_map: Don't use new noTSX models for host-model CPUs
a41c76
MIME-Version: 1.0
a41c76
Content-Type: text/plain; charset=UTF-8
a41c76
Content-Transfer-Encoding: 8bit
a41c76
a41c76
Host-model CPU definitions (and domain capabilities) will use the
a41c76
original CPU models (without noTSX in their name) and explicitly disable
a41c76
hle and rtm features. This way domains with host-model CPUs will be
a41c76
migratable even to older versions of libvirt which do not support the
a41c76
noTSX model variants.
a41c76
a41c76
The new models will be advertised in host capabilities and they may
a41c76
be used explicitly with custom CPUs.
a41c76
a41c76
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
a41c76
Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
a41c76
Tested-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
a41c76
(cherry picked from commit 17cdefe5f197030c70a0d250f3c5387b41663516)
a41c76
a41c76
https://bugzilla.redhat.com/show_bug.cgi?id=1840008
a41c76
a41c76
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
a41c76
Message-Id: <d27a0adb8f142f053fbd830947f03bad04eff264.1590483392.git.jdenemar@redhat.com>
a41c76
Reviewed-by: Ján Tomko <jtomko@redhat.com>
a41c76
---
a41c76
 src/cpu_map/x86_Cascadelake-Server-noTSX.xml           | 2 +-
a41c76
 src/cpu_map/x86_Icelake-Client-noTSX.xml               | 2 +-
a41c76
 src/cpu_map/x86_Icelake-Server-noTSX.xml               | 2 +-
a41c76
 src/cpu_map/x86_Skylake-Client-noTSX-IBRS.xml          | 2 +-
a41c76
 src/cpu_map/x86_Skylake-Server-noTSX-IBRS.xml          | 2 +-
a41c76
 tests/cputestdata/x86_64-cpuid-Core-i7-8550U-guest.xml | 4 +++-
a41c76
 tests/cputestdata/x86_64-cpuid-Core-i7-8550U-json.xml  | 4 +++-
a41c76
 7 files changed, 11 insertions(+), 7 deletions(-)
a41c76
a41c76
diff --git a/src/cpu_map/x86_Cascadelake-Server-noTSX.xml b/src/cpu_map/x86_Cascadelake-Server-noTSX.xml
a41c76
index 5adea664e9..459174a30d 100644
a41c76
--- a/src/cpu_map/x86_Cascadelake-Server-noTSX.xml
a41c76
+++ b/src/cpu_map/x86_Cascadelake-Server-noTSX.xml
a41c76
@@ -1,6 +1,6 @@
a41c76
 <cpus>
a41c76
   <model name='Cascadelake-Server-noTSX'>
a41c76
-    <decode host='on' guest='on'/>
a41c76
+    <decode host='on' guest='off'/>
a41c76
     <signature family='6' model='85'/> 
a41c76
     <vendor name='Intel'/>
a41c76
     <feature name='3dnowprefetch'/>
a41c76
diff --git a/src/cpu_map/x86_Icelake-Client-noTSX.xml b/src/cpu_map/x86_Icelake-Client-noTSX.xml
a41c76
index 540732af6f..65e648ae21 100644
a41c76
--- a/src/cpu_map/x86_Icelake-Client-noTSX.xml
a41c76
+++ b/src/cpu_map/x86_Icelake-Client-noTSX.xml
a41c76
@@ -1,6 +1,6 @@
a41c76
 <cpus>
a41c76
   <model name='Icelake-Client-noTSX'>
a41c76
-    <decode host='on' guest='on'/>
a41c76
+    <decode host='on' guest='off'/>
a41c76
     <signature family='6' model='126'/> 
a41c76
     <vendor name='Intel'/>
a41c76
     <feature name='3dnowprefetch'/>
a41c76
diff --git a/src/cpu_map/x86_Icelake-Server-noTSX.xml b/src/cpu_map/x86_Icelake-Server-noTSX.xml
a41c76
index 5a53da23c7..2fd6906406 100644
a41c76
--- a/src/cpu_map/x86_Icelake-Server-noTSX.xml
a41c76
+++ b/src/cpu_map/x86_Icelake-Server-noTSX.xml
a41c76
@@ -1,6 +1,6 @@
a41c76
 <cpus>
a41c76
   <model name='Icelake-Server-noTSX'>
a41c76
-    <decode host='on' guest='on'/>
a41c76
+    <decode host='on' guest='off'/>
a41c76
     <signature family='6' model='134'/> 
a41c76
     <vendor name='Intel'/>
a41c76
     <feature name='3dnowprefetch'/>
a41c76
diff --git a/src/cpu_map/x86_Skylake-Client-noTSX-IBRS.xml b/src/cpu_map/x86_Skylake-Client-noTSX-IBRS.xml
a41c76
index 0c2f1e6ac4..ffba34502a 100644
a41c76
--- a/src/cpu_map/x86_Skylake-Client-noTSX-IBRS.xml
a41c76
+++ b/src/cpu_map/x86_Skylake-Client-noTSX-IBRS.xml
a41c76
@@ -1,6 +1,6 @@
a41c76
 <cpus>
a41c76
   <model name='Skylake-Client-noTSX-IBRS'>
a41c76
-    <decode host='on' guest='on'/>
a41c76
+    <decode host='on' guest='off'/>
a41c76
     <signature family='6' model='94'/> 
a41c76
     <signature family='6' model='78'/> 
a41c76
     
a41c76
diff --git a/src/cpu_map/x86_Skylake-Server-noTSX-IBRS.xml b/src/cpu_map/x86_Skylake-Server-noTSX-IBRS.xml
a41c76
index 91a206f575..c2b7de40e8 100644
a41c76
--- a/src/cpu_map/x86_Skylake-Server-noTSX-IBRS.xml
a41c76
+++ b/src/cpu_map/x86_Skylake-Server-noTSX-IBRS.xml
a41c76
@@ -1,6 +1,6 @@
a41c76
 <cpus>
a41c76
   <model name='Skylake-Server-noTSX-IBRS'>
a41c76
-    <decode host='on' guest='on'/>
a41c76
+    <decode host='on' guest='off'/>
a41c76
     <signature family='6' model='85'/> 
a41c76
     <vendor name='Intel'/>
a41c76
     <feature name='3dnowprefetch'/>
a41c76
diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-8550U-guest.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-8550U-guest.xml
a41c76
index e03c4a06ba..92404e4d03 100644
a41c76
--- a/tests/cputestdata/x86_64-cpuid-Core-i7-8550U-guest.xml
a41c76
+++ b/tests/cputestdata/x86_64-cpuid-Core-i7-8550U-guest.xml
a41c76
@@ -1,5 +1,5 @@
a41c76
 <cpu mode='custom' match='exact'>
a41c76
-  <model fallback='forbid'>Skylake-Client-noTSX-IBRS</model>
a41c76
+  <model fallback='forbid'>Skylake-Client-IBRS</model>
a41c76
   <vendor>Intel</vendor>
a41c76
   <feature policy='require' name='ds'/>
a41c76
   <feature policy='require' name='acpi'/>
a41c76
@@ -26,4 +26,6 @@
a41c76
   <feature policy='require' name='pdpe1gb'/>
a41c76
   <feature policy='require' name='invtsc'/>
a41c76
   <feature policy='require' name='skip-l1dfl-vmentry'/>
a41c76
+  <feature policy='disable' name='hle'/>
a41c76
+  <feature policy='disable' name='rtm'/>
a41c76
 </cpu>
a41c76
diff --git a/tests/cputestdata/x86_64-cpuid-Core-i7-8550U-json.xml b/tests/cputestdata/x86_64-cpuid-Core-i7-8550U-json.xml
a41c76
index 3d8e6775bf..645c0934c2 100644
a41c76
--- a/tests/cputestdata/x86_64-cpuid-Core-i7-8550U-json.xml
a41c76
+++ b/tests/cputestdata/x86_64-cpuid-Core-i7-8550U-json.xml
a41c76
@@ -1,5 +1,5 @@
a41c76
 <cpu mode='custom' match='exact'>
a41c76
-  <model fallback='forbid'>Skylake-Client-noTSX-IBRS</model>
a41c76
+  <model fallback='forbid'>Skylake-Client-IBRS</model>
a41c76
   <vendor>Intel</vendor>
a41c76
   <feature policy='require' name='ss'/>
a41c76
   <feature policy='require' name='vmx'/>
a41c76
@@ -14,4 +14,6 @@
a41c76
   <feature policy='require' name='xsaves'/>
a41c76
   <feature policy='require' name='pdpe1gb'/>
a41c76
   <feature policy='require' name='skip-l1dfl-vmentry'/>
a41c76
+  <feature policy='disable' name='hle'/>
a41c76
+  <feature policy='disable' name='rtm'/>
a41c76
 </cpu>
a41c76
-- 
a41c76
2.26.2
a41c76