diff mbox series

[RFC,5/8] i386/kvm: hv-evmcs requires hv-vapic

Message ID 20190125114155.32062-6-vkuznets@redhat.com
State New
Headers show
Series i386/kvm/hyper-v: refactor and implement 'hv-stimer-direct' and 'hv-all' enlightenments | expand

Commit Message

Vitaly Kuznetsov Jan. 25, 2019, 11:41 a.m. UTC
Enlightened VMCS is enabled by writing to a field in VP assist page and
these require virtual APIC.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
 target/i386/kvm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index b373b4ac06..674c5dc185 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -1074,7 +1074,7 @@  static int hv_report_missing_dep(X86CPU *cpu, const char *name,
         return 1;
     }
 
-    if (cpu->hyperv_all) {
+    if (cpu->hyperv_all && strcmp(name, "hv-evmcs")) {
         fprintf(stderr, "Hyper-V %s (requested by 'hv-all' cpu flag) "
                 "requires %s (is not supported by kernel)\n",
                 kvm_hyperv_properties[i].desc, kvm_hyperv_properties[j].desc);
@@ -1174,6 +1174,9 @@  static int hyperv_handle_properties(CPUState *cs,
     if (cpu->hyperv_synic && !cpu->hyperv_synic_kvm_only &&
         !cpu->hyperv_vpindex)
         r |= hv_report_missing_dep(cpu, "hv-synic", "hv-vpindex");
+    if (cpu->hyperv_evmcs && !cpu->hyperv_vapic) {
+        r |= hv_report_missing_dep(cpu, "hv-evmcs", "hv-vapic");
+    }
 
     /* Not exposed by KVM but needed to make CPU hotplug in Windows work */
     env->features[FEAT_HYPERV_EDX] |= HV_CPU_DYNAMIC_PARTITIONING_AVAILABLE;