Commit b8e1b962 authored by Sean Christopherson's avatar Sean Christopherson Committed by Paolo Bonzini

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: default avatarSean Christopherson <seanjc@google.com>
Message-Id: <20220614230548.3852141-6-seanjc@google.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent ce0a58f4
...@@ -205,7 +205,7 @@ static inline int apic_x2apic_mode(struct kvm_lapic *apic) ...@@ -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) 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) static inline bool kvm_apic_has_events(struct kvm_vcpu *vcpu)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment