KVM: x86: Don't re-setup empty IRQ routing when KVM_CAP_SPLIT_IRQCHIP
authorYi Wang <foxywang@tencent.com>
Mon, 6 May 2024 10:17:50 +0000 (18:17 +0800)
committerSean Christopherson <seanjc@google.com>
Tue, 11 Jun 2024 21:18:40 +0000 (14:18 -0700)
commite3c89f5dd11df791b55b320c3869a97414ef5d06
treeed6d459e43724ce9c490ecadbdb12979ea340588
parentfbe4a7e881d4408bfabbb4fd538f10fd686cd8ab
KVM: x86: Don't re-setup empty IRQ routing when KVM_CAP_SPLIT_IRQCHIP

Now that KVM sets up empty IRQ routing during VM creation, don't recreate
empty routing during KVM_CAP_SPLIT_IRQCHIP.  Setting IRQ routes during
KVM_CAP_SPLIT_IRQCHIP can result in 20+ milliseconds of delay due to the
synchronize_srcu_expedited() call in kvm_set_irq_routing().

Note, the empty routing is guaranteed to be intact as KVM x86 only allows
changing the IRQ routing after an in-kernel IRQCHIP has been created, and
KVM_CAP_SPLIT_IRQCHIP is disallowed after creating an IRQCHIP.

Signed-off-by: Yi Wang <foxywang@tencent.com>
Link: https://lore.kernel.org/r/20240506101751.3145407-3-foxywang@tencent.com
[sean: massage changelog, remove unused empty_routing array]
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/irq.h
arch/x86/kvm/irq_comm.c
arch/x86/kvm/x86.c