[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 14/17] i386: use global kvm_state in hyperv_enabled() check
From: |
Vitaly Kuznetsov |
Subject: |
[PATCH v5 14/17] i386: use global kvm_state in hyperv_enabled() check |
Date: |
Mon, 1 Mar 2021 14:51:00 +0100 |
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/kvm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index 264f879cd257..3fa6570215b6 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -715,8 +715,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.29.2
- [PATCH v5 04/17] i386: stop using env->features[] for filling Hyper-V CPUIDs, (continued)
- [PATCH v5 04/17] i386: stop using env->features[] for filling Hyper-V CPUIDs, Vitaly Kuznetsov, 2021/03/01
- [PATCH v5 05/17] i386: introduce hyperv_feature_supported(), Vitaly Kuznetsov, 2021/03/01
- [PATCH v5 06/17] i386: introduce hv_cpuid_get_host(), Vitaly Kuznetsov, 2021/03/01
- [PATCH v5 07/17] i386: drop FEAT_HYPERV feature leaves, Vitaly Kuznetsov, 2021/03/01
- [PATCH v5 09/17] i386: split hyperv_handle_properties() into hyperv_expand_features()/hyperv_fill_cpuids(), Vitaly Kuznetsov, 2021/03/01
- [PATCH v5 08/17] i386: introduce hv_cpuid_cache, Vitaly Kuznetsov, 2021/03/01
- [PATCH v5 10/17] i386: move eVMCS enablement to hyperv_init_vcpu(), Vitaly Kuznetsov, 2021/03/01
- [PATCH v5 11/17] i386: switch hyperv_expand_features() to using error_setg(), Vitaly Kuznetsov, 2021/03/01
- [PATCH v5 12/17] i386: adjust the expected KVM_GET_SUPPORTED_HV_CPUID array size, Vitaly Kuznetsov, 2021/03/01
- [PATCH v5 13/17] i386: prefer system KVM_GET_SUPPORTED_HV_CPUID ioctl over vCPU's one, Vitaly Kuznetsov, 2021/03/01
- [PATCH v5 14/17] i386: use global kvm_state in hyperv_enabled() check,
Vitaly Kuznetsov <=
- [PATCH v5 15/17] i386: expand Hyper-V features during CPU feature expansion time, Vitaly Kuznetsov, 2021/03/01
- [PATCH v5 16/17] i386: provide simple 'hv-default=on' option, Vitaly Kuznetsov, 2021/03/01
- [PATCH v5 17/17] qtest/hyperv: Introduce a simple hyper-v test, Vitaly Kuznetsov, 2021/03/01