[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH RFC v2 18/19] i386: use global kvm_state in hyperv_enabled() chec
From: |
Vitaly Kuznetsov |
Subject: |
[PATCH RFC v2 18/19] i386: use global kvm_state in hyperv_enabled() check |
Date: |
Wed, 30 Sep 2020 15:40:26 +0200 |
There is no need to use vCPU-specific kvm state in hyperv_enabled() check
and we need to do that when feature expansion happens early, before vCPU
specific KVM state is created.
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
target/i386/kvm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index af59b5f1a935..2c62122a1bc8 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -729,8 +729,7 @@ unsigned long kvm_arch_vcpu_id(CPUState *cs)
static bool hyperv_enabled(X86CPU *cpu)
{
- CPUState *cs = CPU(cpu);
- return kvm_check_extension(cs->kvm_state, KVM_CAP_HYPERV) > 0 &&
+ return kvm_check_extension(kvm_state, KVM_CAP_HYPERV) > 0 &&
((cpu->hyperv_spinlock_attempts != HYPERV_SPINLOCK_NEVER_NOTIFY) ||
cpu->hyperv_features || cpu->hyperv_passthrough);
}
--
2.25.4
- [PATCH RFC v2 07/19] i386: move hyperv_limits initialization to x86_cpu_realizefn(), (continued)
- [PATCH RFC v2 07/19] i386: move hyperv_limits initialization to x86_cpu_realizefn(), Vitaly Kuznetsov, 2020/09/30
- [PATCH RFC v2 11/19] i386: introduce hv_cpuid_cache, Vitaly Kuznetsov, 2020/09/30
- [PATCH RFC v2 12/19] i386: drop FEAT_HYPERV feature leaves, Vitaly Kuznetsov, 2020/09/30
- [PATCH RFC v2 13/19] i386: split hyperv_handle_properties() into hyperv_expand_features()/hyperv_fill_cpuids(), Vitaly Kuznetsov, 2020/09/30
- [PATCH RFC v2 16/19] i386: adjust the expected KVM_GET_SUPPORTED_HV_CPUID array size, Vitaly Kuznetsov, 2020/09/30
- [PATCH RFC v2 14/19] i386: move eVMCS enablement to hyperv_init_vcpu(), Vitaly Kuznetsov, 2020/09/30
- [PATCH RFC v2 19/19] i386: expand Hyper-V features during CPU feature expansion time, Vitaly Kuznetsov, 2020/09/30
- [PATCH RFC v2 17/19] i386: prefer system KVM_GET_SUPPORTED_HV_CPUID ioctl over vCPU's one, Vitaly Kuznetsov, 2020/09/30
- [PATCH RFC v2 18/19] i386: use global kvm_state in hyperv_enabled() check,
Vitaly Kuznetsov <=
- [PATCH RFC v2 15/19] i386: switch hyperv_expand_features() to using error_setg(), Vitaly Kuznetsov, 2020/09/30