073345
From b77f7c1c1424a758295105b92c5f95ff82d54904 Mon Sep 17 00:00:00 2001
073345
Message-Id: <b77f7c1c1424a758295105b92c5f95ff82d54904@dist-git>
073345
From: Jiri Denemark <jdenemar@redhat.com>
073345
Date: Fri, 7 Feb 2020 10:41:45 +0100
073345
Subject: [PATCH] qemu: Fix KVM features with QEMU 4.1
073345
MIME-Version: 1.0
073345
Content-Type: text/plain; charset=UTF-8
073345
Content-Transfer-Encoding: 8bit
073345
073345
Originally the names of the KVM CPU features were only used internally
073345
for looking up their CPUID bits. So we used "__kvm_" prefix for them to
073345
make sure the names do not collide with normal CPU features stored in
073345
our CPU map.
073345
073345
But with QEMU 4.1 we check which features were enabled or disabled by a
073345
freshly started QEMU process using their names rather than their CPUID
073345
bits (mostly because of MSR features). Thus we need to change our made
073345
up internal names into the actual names used by QEMU.
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 4c62ed606895018aaf9f9f1d2137fcea3918756a)
073345
073345
https://bugzilla.redhat.com/show_bug.cgi?id=1794868
073345
073345
Conflicts:
073345
	src/cpu/cpu_x86_data.h
073345
            - all defines are indented as downstream lacks #pragma once
073345
073345
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
073345
Message-Id: <c565def49ee0f02b19d58717383661a277b770f0.1581064395.git.jdenemar@redhat.com>
073345
Reviewed-by: Ján Tomko <jtomko@redhat.com>
073345
---
073345
 src/cpu/cpu_x86_data.h  | 2 +-
073345
 src/qemu/qemu_command.c | 2 +-
073345
 2 files changed, 2 insertions(+), 2 deletions(-)
073345
073345
diff --git a/src/cpu/cpu_x86_data.h b/src/cpu/cpu_x86_data.h
073345
index 8a189f854e..0087fd2f85 100644
073345
--- a/src/cpu/cpu_x86_data.h
073345
+++ b/src/cpu/cpu_x86_data.h
073345
@@ -49,7 +49,7 @@ struct _virCPUx86MSR {
073345
 # define CPUX86_KVM      0x40000000
073345
 # define CPUX86_EXTENDED 0x80000000
073345
 
073345
-# define VIR_CPU_x86_KVM_PV_UNHALT    "__kvm_pv_unhalt"
073345
+# define VIR_CPU_x86_KVM_PV_UNHALT  "kvm_pv_unhalt"
073345
 
073345
 /*
073345
  * The following HyperV feature names suffixes must exactly match corresponding
073345
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
073345
index 71e102747c..a411d214df 100644
073345
--- a/src/qemu/qemu_command.c
073345
+++ b/src/qemu/qemu_command.c
073345
@@ -7008,7 +7008,7 @@ qemuBuildCpuCommandLine(virCommandPtr cmd,
073345
     }
073345
 
073345
     if (def->features[VIR_DOMAIN_FEATURE_PVSPINLOCK]) {
073345
-        qemuBuildCpuFeature(qemuCaps, &buf, "kvm_pv_unhalt",
073345
+        qemuBuildCpuFeature(qemuCaps, &buf, VIR_CPU_x86_KVM_PV_UNHALT,
073345
                             def->features[VIR_DOMAIN_FEATURE_PVSPINLOCK] == VIR_TRISTATE_SWITCH_ON);
073345
     }
073345
 
073345
-- 
073345
2.25.0
073345