Blob Blame History Raw
From a7a5fd909ea7a5d7608568e94f9a0f7d4478719b Mon Sep 17 00:00:00 2001
Message-Id: <a7a5fd909ea7a5d7608568e94f9a0f7d4478719b@dist-git>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Fri, 7 Feb 2020 10:41:43 +0100
Subject: [PATCH] cpu: Drop KVM_ from hyperv feature macros
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

All the features are hyperv features even though they are provided by
KVM with QEMU. The "KVM" part in the macro names does not make a lot of
sense.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Tested-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit 1ddf014fef4468a15303029fbc563da0aaaf8ce4)

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

Conflicts:
	src/cpu/cpu_x86.c
	src/cpu/cpu_x86_data.h
            - a few extra hyperv features upstream

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Message-Id: <c98a0f397787d6b62621728aed00f48b77521c2c.1581064395.git.jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
 src/cpu/cpu_x86.c       | 45 +++++++++++++++++++++--------------------
 src/cpu/cpu_x86_data.h  | 22 ++++++++++----------
 src/qemu/qemu_command.c |  2 +-
 3 files changed, 35 insertions(+), 34 deletions(-)

diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index cf5ef442e7..ecf11926b4 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -95,27 +95,28 @@ KVM_FEATURE_DEF(VIR_CPU_x86_KVM_PV_UNHALT,
                 0x40000001, 0x00000080);
 KVM_FEATURE_DEF(VIR_CPU_x86_KVM_CLOCKSOURCE_STABLE_BIT,
                 0x40000001, 0x01000000);
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_RUNTIME,
+
+KVM_FEATURE_DEF(VIR_CPU_x86_HV_RUNTIME,
                 0x40000003, 0x00000001);
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_SYNIC,
+KVM_FEATURE_DEF(VIR_CPU_x86_HV_SYNIC,
                 0x40000003, 0x00000004);
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_STIMER,
+KVM_FEATURE_DEF(VIR_CPU_x86_HV_STIMER,
                 0x40000003, 0x00000008);
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_RELAXED,
+KVM_FEATURE_DEF(VIR_CPU_x86_HV_RELAXED,
                 0x40000003, 0x00000020);
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_SPINLOCKS,
+KVM_FEATURE_DEF(VIR_CPU_x86_HV_SPINLOCKS,
                 0x40000003, 0x00000022);
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_VAPIC,
+KVM_FEATURE_DEF(VIR_CPU_x86_HV_VAPIC,
                 0x40000003, 0x00000030);
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_VPINDEX,
+KVM_FEATURE_DEF(VIR_CPU_x86_HV_VPINDEX,
                 0x40000003, 0x00000040);
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_RESET,
+KVM_FEATURE_DEF(VIR_CPU_x86_HV_RESET,
                 0x40000003, 0x00000080);
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_FREQUENCIES,
+KVM_FEATURE_DEF(VIR_CPU_x86_HV_FREQUENCIES,
                 0x40000003, 0x00000800);
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_REENLIGHTENMENT,
+KVM_FEATURE_DEF(VIR_CPU_x86_HV_REENLIGHTENMENT,
                 0x40000003, 0x00002000);
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_TLBFLUSH,
+KVM_FEATURE_DEF(VIR_CPU_x86_HV_TLBFLUSH,
                 0x40000004, 0x00000004);
 
 static virCPUx86Feature x86_kvm_features[] =
@@ -129,17 +130,17 @@ static virCPUx86Feature x86_kvm_features[] =
     KVM_FEATURE(VIR_CPU_x86_KVM_PV_EOI),
     KVM_FEATURE(VIR_CPU_x86_KVM_PV_UNHALT),
     KVM_FEATURE(VIR_CPU_x86_KVM_CLOCKSOURCE_STABLE_BIT),
-    KVM_FEATURE(VIR_CPU_x86_KVM_HV_RUNTIME),
-    KVM_FEATURE(VIR_CPU_x86_KVM_HV_SYNIC),
-    KVM_FEATURE(VIR_CPU_x86_KVM_HV_STIMER),
-    KVM_FEATURE(VIR_CPU_x86_KVM_HV_RELAXED),
-    KVM_FEATURE(VIR_CPU_x86_KVM_HV_SPINLOCKS),
-    KVM_FEATURE(VIR_CPU_x86_KVM_HV_VAPIC),
-    KVM_FEATURE(VIR_CPU_x86_KVM_HV_VPINDEX),
-    KVM_FEATURE(VIR_CPU_x86_KVM_HV_RESET),
-    KVM_FEATURE(VIR_CPU_x86_KVM_HV_FREQUENCIES),
-    KVM_FEATURE(VIR_CPU_x86_KVM_HV_REENLIGHTENMENT),
-    KVM_FEATURE(VIR_CPU_x86_KVM_HV_TLBFLUSH),
+    KVM_FEATURE(VIR_CPU_x86_HV_RUNTIME),
+    KVM_FEATURE(VIR_CPU_x86_HV_SYNIC),
+    KVM_FEATURE(VIR_CPU_x86_HV_STIMER),
+    KVM_FEATURE(VIR_CPU_x86_HV_RELAXED),
+    KVM_FEATURE(VIR_CPU_x86_HV_SPINLOCKS),
+    KVM_FEATURE(VIR_CPU_x86_HV_VAPIC),
+    KVM_FEATURE(VIR_CPU_x86_HV_VPINDEX),
+    KVM_FEATURE(VIR_CPU_x86_HV_RESET),
+    KVM_FEATURE(VIR_CPU_x86_HV_FREQUENCIES),
+    KVM_FEATURE(VIR_CPU_x86_HV_REENLIGHTENMENT),
+    KVM_FEATURE(VIR_CPU_x86_HV_TLBFLUSH),
 };
 
 typedef struct _virCPUx86Model virCPUx86Model;
diff --git a/src/cpu/cpu_x86_data.h b/src/cpu/cpu_x86_data.h
index 77797f633c..9668b13eb9 100644
--- a/src/cpu/cpu_x86_data.h
+++ b/src/cpu/cpu_x86_data.h
@@ -64,17 +64,17 @@ struct _virCPUx86MSR {
  * ones defined for virDomainHyperv in domain_conf.c.
  * E.g "hv-runtime" -> "runtime", "hv-spinlocks" -> "spinlocks" etc.
 */
-# define VIR_CPU_x86_KVM_HV_RUNTIME   "hv-runtime"
-# define VIR_CPU_x86_KVM_HV_SYNIC     "hv-synic"
-# define VIR_CPU_x86_KVM_HV_STIMER    "hv-stimer"
-# define VIR_CPU_x86_KVM_HV_RELAXED   "hv-relaxed"
-# define VIR_CPU_x86_KVM_HV_SPINLOCKS "hv-spinlocks"
-# define VIR_CPU_x86_KVM_HV_VAPIC     "hv-vapic"
-# define VIR_CPU_x86_KVM_HV_VPINDEX   "hv-vpindex"
-# define VIR_CPU_x86_KVM_HV_RESET     "hv-reset"
-# define VIR_CPU_x86_KVM_HV_FREQUENCIES "hv-frequencies"
-# define VIR_CPU_x86_KVM_HV_REENLIGHTENMENT "hv-reenlightenment"
-# define VIR_CPU_x86_KVM_HV_TLBFLUSH  "hv-tlbflush"
+# define VIR_CPU_x86_HV_RUNTIME   "hv-runtime"
+# define VIR_CPU_x86_HV_SYNIC     "hv-synic"
+# define VIR_CPU_x86_HV_STIMER    "hv-stimer"
+# define VIR_CPU_x86_HV_RELAXED   "hv-relaxed"
+# define VIR_CPU_x86_HV_SPINLOCKS "hv-spinlocks"
+# define VIR_CPU_x86_HV_VAPIC     "hv-vapic"
+# define VIR_CPU_x86_HV_VPINDEX   "hv-vpindex"
+# define VIR_CPU_x86_HV_RESET     "hv-reset"
+# define VIR_CPU_x86_HV_FREQUENCIES "hv-frequencies"
+# define VIR_CPU_x86_HV_REENLIGHTENMENT "hv-reenlightenment"
+# define VIR_CPU_x86_HV_TLBFLUSH  "hv-tlbflush"
 
 
 # define VIR_CPU_X86_DATA_INIT { 0 }
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 0289a907a1..71e102747c 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7039,7 +7039,7 @@ qemuBuildCpuCommandLine(virCommandPtr cmd,
             case VIR_DOMAIN_HYPERV_SPINLOCKS:
                 if (def->hyperv_features[i] == VIR_TRISTATE_SWITCH_ON)
                     virBufferAsprintf(&buf, ",%s=0x%x",
-                                      VIR_CPU_x86_KVM_HV_SPINLOCKS,
+                                      VIR_CPU_x86_HV_SPINLOCKS,
                                       def->hyperv_spinlocks);
                 break;
 
-- 
2.25.0