[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH RFC 20/22] i386: use global kvm_state in hyperv_enabled() check
From: |
Vitaly Kuznetsov |
Subject: |
[PATCH RFC 20/22] i386: use global kvm_state in hyperv_enabled() check |
Date: |
Fri, 4 Sep 2020 16:54:29 +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 c17e7db5e627..0945983498b2 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -728,8 +728,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_RETRY) ||
cpu->hyperv_features || cpu->hyperv_passthrough);
}
--
2.25.4
- [PATCH RFC 18/22] i386: prefer system KVM_GET_SUPPORTED_HV_CPUID ioctl over vCPU's one, (continued)
- [PATCH RFC 18/22] i386: prefer system KVM_GET_SUPPORTED_HV_CPUID ioctl over vCPU's one, Vitaly Kuznetsov, 2020/09/04
- [PATCH RFC 22/22] i386: expand Hyper-V features early, Vitaly Kuznetsov, 2020/09/04
- [PATCH RFC 21/22] i386: record if Hyper-V features were already expanded, Vitaly Kuznetsov, 2020/09/04
- [PATCH RFC 19/22] i386: prepare hyperv_expand_features() to be called at CPU feature expansion time, Vitaly Kuznetsov, 2020/09/04
- [PATCH RFC 16/22] i386: make hyperv_expand_features() return void, Vitaly Kuznetsov, 2020/09/04
- [PATCH RFC 17/22] i386: adjust the expected KVM_GET_SUPPORTED_HV_CPUID array size, Vitaly Kuznetsov, 2020/09/04
- [PATCH RFC 20/22] i386: use global kvm_state in hyperv_enabled() check,
Vitaly Kuznetsov <=