Pablo Greco 40546a
From 900c638797181010d2341a8a5496c1335286353e Mon Sep 17 00:00:00 2001
Pablo Greco 40546a
Message-Id: <900c638797181010d2341a8a5496c1335286353e@dist-git>
Pablo Greco 40546a
From: Jiri Denemark <jdenemar@redhat.com>
Pablo Greco 40546a
Date: Fri, 7 Feb 2020 12:01:18 +0100
Pablo Greco 40546a
Subject: [PATCH] cpu: Drop CPUID definition for hv-spinlocks
Pablo Greco 40546a
MIME-Version: 1.0
Pablo Greco 40546a
Content-Type: text/plain; charset=UTF-8
Pablo Greco 40546a
Content-Transfer-Encoding: 8bit
Pablo Greco 40546a
Pablo Greco 40546a
hv-spinlocks is not a CPUID feature and should not be checked as such.
Pablo Greco 40546a
While starting a domain with hv-spinlocks enabled, we would report a
Pablo Greco 40546a
warning about unsupported hyperv spinlocks feature even though it was
Pablo Greco 40546a
set properly.
Pablo Greco 40546a
Pablo Greco 40546a
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Pablo Greco 40546a
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Pablo Greco 40546a
(cherry picked from commit ad9d5d3a6a1fc86fca1620278cbd113e08370ba2)
Pablo Greco 40546a
Pablo Greco 40546a
https://bugzilla.redhat.com/show_bug.cgi?id=1794868
Pablo Greco 40546a
Pablo Greco 40546a
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Pablo Greco 40546a
Message-Id: <f3040b3536c025c78b1613a487c519993a950c24.1581073232.git.jdenemar@redhat.com>
Pablo Greco 40546a
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Pablo Greco 40546a
---
Pablo Greco 40546a
 src/cpu/cpu_x86.c       | 3 ---
Pablo Greco 40546a
 src/qemu/qemu_process.c | 5 +++--
Pablo Greco 40546a
 2 files changed, 3 insertions(+), 5 deletions(-)
Pablo Greco 40546a
Pablo Greco 40546a
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
Pablo Greco 40546a
index 0459a0d1c8..a985913e5e 100644
Pablo Greco 40546a
--- a/src/cpu/cpu_x86.c
Pablo Greco 40546a
+++ b/src/cpu/cpu_x86.c
Pablo Greco 40546a
@@ -88,8 +88,6 @@ KVM_FEATURE_DEF(VIR_CPU_x86_HV_STIMER,
Pablo Greco 40546a
                 0x40000003, 0x00000008);
Pablo Greco 40546a
 KVM_FEATURE_DEF(VIR_CPU_x86_HV_RELAXED,
Pablo Greco 40546a
                 0x40000003, 0x00000020);
Pablo Greco 40546a
-KVM_FEATURE_DEF(VIR_CPU_x86_HV_SPINLOCKS,
Pablo Greco 40546a
-                0x40000003, 0x00000022);
Pablo Greco 40546a
 KVM_FEATURE_DEF(VIR_CPU_x86_HV_VAPIC,
Pablo Greco 40546a
                 0x40000003, 0x00000030);
Pablo Greco 40546a
 KVM_FEATURE_DEF(VIR_CPU_x86_HV_VPINDEX,
Pablo Greco 40546a
@@ -110,7 +108,6 @@ static virCPUx86Feature x86_kvm_features[] =
Pablo Greco 40546a
     KVM_FEATURE(VIR_CPU_x86_HV_SYNIC),
Pablo Greco 40546a
     KVM_FEATURE(VIR_CPU_x86_HV_STIMER),
Pablo Greco 40546a
     KVM_FEATURE(VIR_CPU_x86_HV_RELAXED),
Pablo Greco 40546a
-    KVM_FEATURE(VIR_CPU_x86_HV_SPINLOCKS),
Pablo Greco 40546a
     KVM_FEATURE(VIR_CPU_x86_HV_VAPIC),
Pablo Greco 40546a
     KVM_FEATURE(VIR_CPU_x86_HV_VPINDEX),
Pablo Greco 40546a
     KVM_FEATURE(VIR_CPU_x86_HV_RESET),
Pablo Greco 40546a
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
Pablo Greco 40546a
index 312ce69ba5..17d48357b3 100644
Pablo Greco 40546a
--- a/src/qemu/qemu_process.c
Pablo Greco 40546a
+++ b/src/qemu/qemu_process.c
Pablo Greco 40546a
@@ -3917,7 +3917,8 @@ qemuProcessVerifyHypervFeatures(virDomainDefPtr def,
Pablo Greco 40546a
 
Pablo Greco 40546a
     for (i = 0; i < VIR_DOMAIN_HYPERV_LAST; i++) {
Pablo Greco 40546a
         /* always supported string property */
Pablo Greco 40546a
-        if (i == VIR_DOMAIN_HYPERV_VENDOR_ID)
Pablo Greco 40546a
+        if (i == VIR_DOMAIN_HYPERV_VENDOR_ID ||
Pablo Greco 40546a
+            i == VIR_DOMAIN_HYPERV_SPINLOCKS)
Pablo Greco 40546a
             continue;
Pablo Greco 40546a
 
Pablo Greco 40546a
         if (def->hyperv_features[i] != VIR_TRISTATE_SWITCH_ON)
Pablo Greco 40546a
@@ -3938,7 +3939,6 @@ qemuProcessVerifyHypervFeatures(virDomainDefPtr def,
Pablo Greco 40546a
         switch ((virDomainHyperv) i) {
Pablo Greco 40546a
         case VIR_DOMAIN_HYPERV_RELAXED:
Pablo Greco 40546a
         case VIR_DOMAIN_HYPERV_VAPIC:
Pablo Greco 40546a
-        case VIR_DOMAIN_HYPERV_SPINLOCKS:
Pablo Greco 40546a
             VIR_WARN("host doesn't support hyperv '%s' feature",
Pablo Greco 40546a
                      virDomainHypervTypeToString(i));
Pablo Greco 40546a
             break;
Pablo Greco 40546a
@@ -3957,6 +3957,7 @@ qemuProcessVerifyHypervFeatures(virDomainDefPtr def,
Pablo Greco 40546a
             return -1;
Pablo Greco 40546a
 
Pablo Greco 40546a
         /* coverity[dead_error_begin] */
Pablo Greco 40546a
+        case VIR_DOMAIN_HYPERV_SPINLOCKS:
Pablo Greco 40546a
         case VIR_DOMAIN_HYPERV_VENDOR_ID:
Pablo Greco 40546a
         case VIR_DOMAIN_HYPERV_LAST:
Pablo Greco 40546a
             break;
Pablo Greco 40546a
-- 
Pablo Greco 40546a
2.25.0
Pablo Greco 40546a