Skip to content

Commit 0047fb3

Browse files
sean-jcbonzini
authored andcommitted
KVM: x86: Skip KVM_GUESTDBG_BLOCKIRQ APICv update if APICv is disabled
Skip the APICv inhibit update for KVM_GUESTDBG_BLOCKIRQ if APICv is disabled at the module level to avoid having to acquire the mutex and potentially process all vCPUs. The DISABLE inhibit will (barring bugs) never be lifted, so piling on more inhibits is unnecessary. Fixes: cae72dc ("KVM: x86: inhibit APICv when KVM_GUESTDBG_BLOCKIRQ active") Cc: Maxim Levitsky <mlevitsk@redhat.com> Signed-off-by: Sean Christopherson <seanjc@google.com> Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> Message-Id: <20220420013732.3308816-5-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 423ecfe commit 0047fb3

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

arch/x86/kvm/x86.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10978,6 +10978,9 @@ static void kvm_arch_vcpu_guestdbg_update_apicv_inhibit(struct kvm *kvm)
1097810978
struct kvm_vcpu *vcpu;
1097910979
unsigned long i;
1098010980

10981+
if (!enable_apicv)
10982+
return;
10983+
1098110984
down_write(&kvm->arch.apicv_update_lock);
1098210985

1098310986
kvm_for_each_vcpu(i, vcpu, kvm) {

0 commit comments

Comments
 (0)