Blob Blame History Raw
From 287c112945dda0837c31348dc3c07ad7ed19596f Mon Sep 17 00:00:00 2001
Message-Id: <287c112945dda0837c31348dc3c07ad7ed19596f@dist-git>
From: Tim Wiederhake <twiederh@redhat.com>
Date: Fri, 15 Jan 2021 15:17:20 +0100
Subject: [PATCH] cpu_map: Add support for core-capability CPU feature

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
(cherry picked from commit e06dd56032acf904da1aedfc097fa0cae7cb0b0f)

https://bugzilla.redhat.com/show_bug.cgi?id=1537734

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Message-Id: <20210115141722.14986-5-twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/cpu_map/x86_features.xml                           | 3 +++
 tests/cputestdata/x86_64-cpuid-Atom-P5362-disabled.xml | 2 +-
 tests/cputestdata/x86_64-cpuid-Atom-P5362-guest.xml    | 1 +
 tests/cputestdata/x86_64-cpuid-Atom-P5362-host.xml     | 1 +
 4 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/cpu_map/x86_features.xml b/src/cpu_map/x86_features.xml
index 70e1c7b3fc..f8c0b9046c 100644
--- a/src/cpu_map/x86_features.xml
+++ b/src/cpu_map/x86_features.xml
@@ -350,6 +350,9 @@
   <feature name='arch-capabilities'> <!-- arch_capabilities, arch-facilities -->
     <cpuid eax_in='0x07' ecx_in='0x00' edx='0x20000000'/>
   </feature>
+  <feature name='core-capability'>
+    <cpuid eax_in='0x07' ecx_in='0x00' edx='0x40000000'/>
+  </feature>
   <feature name='ssbd'>
     <cpuid eax_in='0x07' ecx_in='0x00' edx='0x80000000'/>
   </feature>
diff --git a/tests/cputestdata/x86_64-cpuid-Atom-P5362-disabled.xml b/tests/cputestdata/x86_64-cpuid-Atom-P5362-disabled.xml
index 842c7b4a2a..50e8084140 100644
--- a/tests/cputestdata/x86_64-cpuid-Atom-P5362-disabled.xml
+++ b/tests/cputestdata/x86_64-cpuid-Atom-P5362-disabled.xml
@@ -1,7 +1,7 @@
 <!-- Features disabled by QEMU -->
 <cpudata arch='x86'>
   <cpuid eax_in='0x00000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x080041dc' edx='0xb0600000'/>
-  <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x02001000' ecx='0x00000020' edx='0x00000000'/>
+  <cpuid eax_in='0x00000007' ecx_in='0x00' eax='0x00000000' ebx='0x02001000' ecx='0x00000020' edx='0x40000000'/>
   <cpuid eax_in='0x0000000f' ecx_in='0x01' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000006'/>
   <cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/>
   <msr index='0x10a' edx='0x00000000' eax='0x00000100'/>
diff --git a/tests/cputestdata/x86_64-cpuid-Atom-P5362-guest.xml b/tests/cputestdata/x86_64-cpuid-Atom-P5362-guest.xml
index 0f3e2e506e..4ad95f06b4 100644
--- a/tests/cputestdata/x86_64-cpuid-Atom-P5362-guest.xml
+++ b/tests/cputestdata/x86_64-cpuid-Atom-P5362-guest.xml
@@ -37,6 +37,7 @@
   <feature policy='require' name='md-clear'/>
   <feature policy='require' name='stibp'/>
   <feature policy='require' name='arch-capabilities'/>
+  <feature policy='require' name='core-capability'/>
   <feature policy='require' name='ssbd'/>
   <feature policy='require' name='xsaveopt'/>
   <feature policy='require' name='xsavec'/>
diff --git a/tests/cputestdata/x86_64-cpuid-Atom-P5362-host.xml b/tests/cputestdata/x86_64-cpuid-Atom-P5362-host.xml
index 3bd009c1da..cc2b208e6a 100644
--- a/tests/cputestdata/x86_64-cpuid-Atom-P5362-host.xml
+++ b/tests/cputestdata/x86_64-cpuid-Atom-P5362-host.xml
@@ -47,6 +47,7 @@
   <feature name='md-clear'/>
   <feature name='stibp'/>
   <feature name='arch-capabilities'/>
+  <feature name='core-capability'/>
   <feature name='ssbd'/>
   <feature name='xsaveopt'/>
   <feature name='xsavec'/>
-- 
2.30.0