[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 14/21] i386: use global kvm_state in hyperv_enabled() check
From: |
Vitaly Kuznetsov |
Subject: |
[PATCH v4 14/21] i386: use global kvm_state in hyperv_enabled() check |
Date: |
Wed, 10 Feb 2021 17:40:26 +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 48484592fc03..47fc564747a3 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -714,8 +714,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 v4 05/21] i386: introduce hyperv_feature_supported(), (continued)
- [PATCH v4 05/21] i386: introduce hyperv_feature_supported(), Vitaly Kuznetsov, 2021/02/10
- [PATCH v4 06/21] i386: introduce hv_cpuid_get_host(), Vitaly Kuznetsov, 2021/02/10
- [PATCH v4 11/21] i386: switch hyperv_expand_features() to using error_setg(), Vitaly Kuznetsov, 2021/02/10
- [PATCH v4 12/21] i386: adjust the expected KVM_GET_SUPPORTED_HV_CPUID array size, Vitaly Kuznetsov, 2021/02/10
- [PATCH v4 10/21] i386: move eVMCS enablement to hyperv_init_vcpu(), Vitaly Kuznetsov, 2021/02/10
- [PATCH v4 13/21] i386: prefer system KVM_GET_SUPPORTED_HV_CPUID ioctl over vCPU's one, Vitaly Kuznetsov, 2021/02/10
- [PATCH v4 16/21] i386: track explicit 'hv-*' features enablement/disablement, Vitaly Kuznetsov, 2021/02/10
- [PATCH v4 15/21] i386: expand Hyper-V features during CPU feature expansion time, Vitaly Kuznetsov, 2021/02/10
- [PATCH v4 14/21] i386: use global kvm_state in hyperv_enabled() check,
Vitaly Kuznetsov <=
- [PATCH v4 21/21] qtest/hyperv: Introduce a simple hyper-v test, Vitaly Kuznetsov, 2021/02/10
- [PATCH v4 20/21] i386: provide simple 'hv-default=on' option, Vitaly Kuznetsov, 2021/02/10
- [PATCH v4 17/21] i386: support 'hv-passthrough, hv-feature=off' on the command line, Vitaly Kuznetsov, 2021/02/10
- [PATCH v4 18/21] i386: be more picky about implicit 'hv-evmcs' enablement, Vitaly Kuznetsov, 2021/02/10