073345
From a7a5fd909ea7a5d7608568e94f9a0f7d4478719b Mon Sep 17 00:00:00 2001
073345
Message-Id: <a7a5fd909ea7a5d7608568e94f9a0f7d4478719b@dist-git>
073345
From: Jiri Denemark <jdenemar@redhat.com>
073345
Date: Fri, 7 Feb 2020 10:41:43 +0100
073345
Subject: [PATCH] cpu: Drop KVM_ from hyperv feature macros
073345
MIME-Version: 1.0
073345
Content-Type: text/plain; charset=UTF-8
073345
Content-Transfer-Encoding: 8bit
073345
073345
All the features are hyperv features even though they are provided by
073345
KVM with QEMU. The "KVM" part in the macro names does not make a lot of
073345
sense.
073345
073345
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
073345
Tested-by: Vitaly Kuznetsov <vkuznets@redhat.com>
073345
Reviewed-by: Ján Tomko <jtomko@redhat.com>
073345
(cherry picked from commit 1ddf014fef4468a15303029fbc563da0aaaf8ce4)
073345
073345
https://bugzilla.redhat.com/show_bug.cgi?id=1794868
073345
073345
Conflicts:
073345
	src/cpu/cpu_x86.c
073345
	src/cpu/cpu_x86_data.h
073345
            - a few extra hyperv features upstream
073345
073345
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
073345
Message-Id: <c98a0f397787d6b62621728aed00f48b77521c2c.1581064395.git.jdenemar@redhat.com>
073345
Reviewed-by: Ján Tomko <jtomko@redhat.com>
073345
---
073345
 src/cpu/cpu_x86.c       | 45 +++++++++++++++++++++--------------------
073345
 src/cpu/cpu_x86_data.h  | 22 ++++++++++----------
073345
 src/qemu/qemu_command.c |  2 +-
073345
 3 files changed, 35 insertions(+), 34 deletions(-)
073345
073345
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
073345
index cf5ef442e7..ecf11926b4 100644
073345
--- a/src/cpu/cpu_x86.c
073345
+++ b/src/cpu/cpu_x86.c
073345
@@ -95,27 +95,28 @@ KVM_FEATURE_DEF(VIR_CPU_x86_KVM_PV_UNHALT,
073345
                 0x40000001, 0x00000080);
073345
 KVM_FEATURE_DEF(VIR_CPU_x86_KVM_CLOCKSOURCE_STABLE_BIT,
073345
                 0x40000001, 0x01000000);
073345
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_RUNTIME,
073345
+
073345
+KVM_FEATURE_DEF(VIR_CPU_x86_HV_RUNTIME,
073345
                 0x40000003, 0x00000001);
073345
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_SYNIC,
073345
+KVM_FEATURE_DEF(VIR_CPU_x86_HV_SYNIC,
073345
                 0x40000003, 0x00000004);
073345
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_STIMER,
073345
+KVM_FEATURE_DEF(VIR_CPU_x86_HV_STIMER,
073345
                 0x40000003, 0x00000008);
073345
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_RELAXED,
073345
+KVM_FEATURE_DEF(VIR_CPU_x86_HV_RELAXED,
073345
                 0x40000003, 0x00000020);
073345
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_SPINLOCKS,
073345
+KVM_FEATURE_DEF(VIR_CPU_x86_HV_SPINLOCKS,
073345
                 0x40000003, 0x00000022);
073345
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_VAPIC,
073345
+KVM_FEATURE_DEF(VIR_CPU_x86_HV_VAPIC,
073345
                 0x40000003, 0x00000030);
073345
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_VPINDEX,
073345
+KVM_FEATURE_DEF(VIR_CPU_x86_HV_VPINDEX,
073345
                 0x40000003, 0x00000040);
073345
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_RESET,
073345
+KVM_FEATURE_DEF(VIR_CPU_x86_HV_RESET,
073345
                 0x40000003, 0x00000080);
073345
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_FREQUENCIES,
073345
+KVM_FEATURE_DEF(VIR_CPU_x86_HV_FREQUENCIES,
073345
                 0x40000003, 0x00000800);
073345
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_REENLIGHTENMENT,
073345
+KVM_FEATURE_DEF(VIR_CPU_x86_HV_REENLIGHTENMENT,
073345
                 0x40000003, 0x00002000);
073345
-KVM_FEATURE_DEF(VIR_CPU_x86_KVM_HV_TLBFLUSH,
073345
+KVM_FEATURE_DEF(VIR_CPU_x86_HV_TLBFLUSH,
073345
                 0x40000004, 0x00000004);
073345
 
073345
 static virCPUx86Feature x86_kvm_features[] =
073345
@@ -129,17 +130,17 @@ static virCPUx86Feature x86_kvm_features[] =
073345
     KVM_FEATURE(VIR_CPU_x86_KVM_PV_EOI),
073345
     KVM_FEATURE(VIR_CPU_x86_KVM_PV_UNHALT),
073345
     KVM_FEATURE(VIR_CPU_x86_KVM_CLOCKSOURCE_STABLE_BIT),
073345
-    KVM_FEATURE(VIR_CPU_x86_KVM_HV_RUNTIME),
073345
-    KVM_FEATURE(VIR_CPU_x86_KVM_HV_SYNIC),
073345
-    KVM_FEATURE(VIR_CPU_x86_KVM_HV_STIMER),
073345
-    KVM_FEATURE(VIR_CPU_x86_KVM_HV_RELAXED),
073345
-    KVM_FEATURE(VIR_CPU_x86_KVM_HV_SPINLOCKS),
073345
-    KVM_FEATURE(VIR_CPU_x86_KVM_HV_VAPIC),
073345
-    KVM_FEATURE(VIR_CPU_x86_KVM_HV_VPINDEX),
073345
-    KVM_FEATURE(VIR_CPU_x86_KVM_HV_RESET),
073345
-    KVM_FEATURE(VIR_CPU_x86_KVM_HV_FREQUENCIES),
073345
-    KVM_FEATURE(VIR_CPU_x86_KVM_HV_REENLIGHTENMENT),
073345
-    KVM_FEATURE(VIR_CPU_x86_KVM_HV_TLBFLUSH),
073345
+    KVM_FEATURE(VIR_CPU_x86_HV_RUNTIME),
073345
+    KVM_FEATURE(VIR_CPU_x86_HV_SYNIC),
073345
+    KVM_FEATURE(VIR_CPU_x86_HV_STIMER),
073345
+    KVM_FEATURE(VIR_CPU_x86_HV_RELAXED),
073345
+    KVM_FEATURE(VIR_CPU_x86_HV_SPINLOCKS),
073345
+    KVM_FEATURE(VIR_CPU_x86_HV_VAPIC),
073345
+    KVM_FEATURE(VIR_CPU_x86_HV_VPINDEX),
073345
+    KVM_FEATURE(VIR_CPU_x86_HV_RESET),
073345
+    KVM_FEATURE(VIR_CPU_x86_HV_FREQUENCIES),
073345
+    KVM_FEATURE(VIR_CPU_x86_HV_REENLIGHTENMENT),
073345
+    KVM_FEATURE(VIR_CPU_x86_HV_TLBFLUSH),
073345
 };
073345
 
073345
 typedef struct _virCPUx86Model virCPUx86Model;
073345
diff --git a/src/cpu/cpu_x86_data.h b/src/cpu/cpu_x86_data.h
073345
index 77797f633c..9668b13eb9 100644
073345
--- a/src/cpu/cpu_x86_data.h
073345
+++ b/src/cpu/cpu_x86_data.h
073345
@@ -64,17 +64,17 @@ struct _virCPUx86MSR {
073345
  * ones defined for virDomainHyperv in domain_conf.c.
073345
  * E.g "hv-runtime" -> "runtime", "hv-spinlocks" -> "spinlocks" etc.
073345
 */
073345
-# define VIR_CPU_x86_KVM_HV_RUNTIME   "hv-runtime"
073345
-# define VIR_CPU_x86_KVM_HV_SYNIC     "hv-synic"
073345
-# define VIR_CPU_x86_KVM_HV_STIMER    "hv-stimer"
073345
-# define VIR_CPU_x86_KVM_HV_RELAXED   "hv-relaxed"
073345
-# define VIR_CPU_x86_KVM_HV_SPINLOCKS "hv-spinlocks"
073345
-# define VIR_CPU_x86_KVM_HV_VAPIC     "hv-vapic"
073345
-# define VIR_CPU_x86_KVM_HV_VPINDEX   "hv-vpindex"
073345
-# define VIR_CPU_x86_KVM_HV_RESET     "hv-reset"
073345
-# define VIR_CPU_x86_KVM_HV_FREQUENCIES "hv-frequencies"
073345
-# define VIR_CPU_x86_KVM_HV_REENLIGHTENMENT "hv-reenlightenment"
073345
-# define VIR_CPU_x86_KVM_HV_TLBFLUSH  "hv-tlbflush"
073345
+# define VIR_CPU_x86_HV_RUNTIME   "hv-runtime"
073345
+# define VIR_CPU_x86_HV_SYNIC     "hv-synic"
073345
+# define VIR_CPU_x86_HV_STIMER    "hv-stimer"
073345
+# define VIR_CPU_x86_HV_RELAXED   "hv-relaxed"
073345
+# define VIR_CPU_x86_HV_SPINLOCKS "hv-spinlocks"
073345
+# define VIR_CPU_x86_HV_VAPIC     "hv-vapic"
073345
+# define VIR_CPU_x86_HV_VPINDEX   "hv-vpindex"
073345
+# define VIR_CPU_x86_HV_RESET     "hv-reset"
073345
+# define VIR_CPU_x86_HV_FREQUENCIES "hv-frequencies"
073345
+# define VIR_CPU_x86_HV_REENLIGHTENMENT "hv-reenlightenment"
073345
+# define VIR_CPU_x86_HV_TLBFLUSH  "hv-tlbflush"
073345
 
073345
 
073345
 # define VIR_CPU_X86_DATA_INIT { 0 }
073345
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
073345
index 0289a907a1..71e102747c 100644
073345
--- a/src/qemu/qemu_command.c
073345
+++ b/src/qemu/qemu_command.c
073345
@@ -7039,7 +7039,7 @@ qemuBuildCpuCommandLine(virCommandPtr cmd,
073345
             case VIR_DOMAIN_HYPERV_SPINLOCKS:
073345
                 if (def->hyperv_features[i] == VIR_TRISTATE_SWITCH_ON)
073345
                     virBufferAsprintf(&buf, ",%s=0x%x",
073345
-                                      VIR_CPU_x86_KVM_HV_SPINLOCKS,
073345
+                                      VIR_CPU_x86_HV_SPINLOCKS,
073345
                                       def->hyperv_spinlocks);
073345
                 break;
073345
 
073345
-- 
073345
2.25.0
073345