diff options
author | Sean Christopherson <seanjc@google.com> | 2022-06-15 02:05:48 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-06-20 13:21:25 +0300 |
commit | b8e1b9626746209c980ce3fbf9ec3fc86910873d (patch) | |
tree | 851b334053b21767ae6a922aaad65f4a2a93d137 /arch | |
parent | ce0a58f4756c14d7646cfdf279dbaada9d7712a0 (diff) | |
download | linux-b8e1b9626746209c980ce3fbf9ec3fc86910873d.tar.xz |
KVM: x86: Use lapic_in_kernel() to query in-kernel APIC in APICv helper
Use lapic_in_kernel() in kvm_vcpu_apicv_active() to take advantage of the
kvm_has_noapic_vcpu static branch.
No functional change intended.
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220614230548.3852141-6-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/lapic.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/lapic.h b/arch/x86/kvm/lapic.h index e09ad97f3250..6207b64b1281 100644 --- a/arch/x86/kvm/lapic.h +++ b/arch/x86/kvm/lapic.h @@ -205,7 +205,7 @@ static inline int apic_x2apic_mode(struct kvm_lapic *apic) static inline bool kvm_vcpu_apicv_active(struct kvm_vcpu *vcpu) { - return vcpu->arch.apic && vcpu->arch.apic->apicv_active; + return lapic_in_kernel(vcpu) && vcpu->arch.apic->apicv_active; } static inline bool kvm_apic_has_events(struct kvm_vcpu *vcpu) |