Skip to content

Commit b33252b

Browse files
committed
KVM: Don't WARN if updating IRQ bypass route fails
Don't bother WARNing if updating an IRTE route fails now that vendor code provides much more precise WARNs. The generic WARN doesn't provide enough information to actually debug the problem, and has obviously done nothing to surface the myriad bugs in KVM x86's implementation. Drop all of the associated return code plumbing that existed just so that common KVM could WARN. Link: https://lore.kernel.org/r/20250611224604.313496-34-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 53527ea commit b33252b

File tree

6 files changed

+20
-25
lines changed

6 files changed

+20
-25
lines changed

arch/arm64/kvm/arm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2771,9 +2771,9 @@ bool kvm_arch_irqfd_route_changed(struct kvm_kernel_irq_routing_entry *old,
27712771
return memcmp(&old->msi, &new->msi, sizeof(new->msi));
27722772
}
27732773

2774-
int kvm_arch_update_irqfd_routing(struct kvm_kernel_irqfd *irqfd,
2775-
struct kvm_kernel_irq_routing_entry *old,
2776-
struct kvm_kernel_irq_routing_entry *new)
2774+
void kvm_arch_update_irqfd_routing(struct kvm_kernel_irqfd *irqfd,
2775+
struct kvm_kernel_irq_routing_entry *old,
2776+
struct kvm_kernel_irq_routing_entry *new)
27772777
{
27782778
/*
27792779
* Remapping the vLPI requires taking the its_lock mutex to resolve

arch/arm64/kvm/vgic/vgic-v4.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -527,18 +527,17 @@ static struct vgic_irq *__vgic_host_irq_get_vlpi(struct kvm *kvm, int host_irq)
527527
return NULL;
528528
}
529529

530-
int kvm_vgic_v4_unset_forwarding(struct kvm *kvm, int host_irq)
530+
void kvm_vgic_v4_unset_forwarding(struct kvm *kvm, int host_irq)
531531
{
532532
struct vgic_irq *irq;
533533
unsigned long flags;
534-
int ret = 0;
535534

536535
if (!vgic_supports_direct_msis(kvm))
537-
return 0;
536+
return;
538537

539538
irq = __vgic_host_irq_get_vlpi(kvm, host_irq);
540539
if (!irq)
541-
return 0;
540+
return;
542541

543542
raw_spin_lock_irqsave(&irq->irq_lock, flags);
544543
WARN_ON(irq->hw && irq->host_irq != host_irq);
@@ -550,5 +549,4 @@ int kvm_vgic_v4_unset_forwarding(struct kvm *kvm, int host_irq)
550549

551550
raw_spin_unlock_irqrestore(&irq->irq_lock, flags);
552551
vgic_put_irq(kvm, irq);
553-
return 0;
554552
}

arch/x86/kvm/irq.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -606,11 +606,11 @@ void kvm_arch_irq_bypass_del_producer(struct irq_bypass_consumer *cons,
606606
kvm_arch_end_assignment(irqfd->kvm);
607607
}
608608

609-
int kvm_arch_update_irqfd_routing(struct kvm_kernel_irqfd *irqfd,
610-
struct kvm_kernel_irq_routing_entry *old,
611-
struct kvm_kernel_irq_routing_entry *new)
609+
void kvm_arch_update_irqfd_routing(struct kvm_kernel_irqfd *irqfd,
610+
struct kvm_kernel_irq_routing_entry *old,
611+
struct kvm_kernel_irq_routing_entry *new)
612612
{
613-
return kvm_pi_update_irte(irqfd, new);
613+
kvm_pi_update_irte(irqfd, new);
614614
}
615615

616616
bool kvm_arch_irqfd_route_changed(struct kvm_kernel_irq_routing_entry *old,

include/kvm/arm_vgic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ struct kvm_kernel_irq_routing_entry;
434434
int kvm_vgic_v4_set_forwarding(struct kvm *kvm, int irq,
435435
struct kvm_kernel_irq_routing_entry *irq_entry);
436436

437-
int kvm_vgic_v4_unset_forwarding(struct kvm *kvm, int host_irq);
437+
void kvm_vgic_v4_unset_forwarding(struct kvm *kvm, int host_irq);
438438

439439
int vgic_v4_load(struct kvm_vcpu *vcpu);
440440
void vgic_v4_commit(struct kvm_vcpu *vcpu);

include/linux/kvm_host.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2410,9 +2410,9 @@ void kvm_arch_irq_bypass_del_producer(struct irq_bypass_consumer *,
24102410
struct irq_bypass_producer *);
24112411
void kvm_arch_irq_bypass_stop(struct irq_bypass_consumer *);
24122412
void kvm_arch_irq_bypass_start(struct irq_bypass_consumer *);
2413-
int kvm_arch_update_irqfd_routing(struct kvm_kernel_irqfd *irqfd,
2414-
struct kvm_kernel_irq_routing_entry *old,
2415-
struct kvm_kernel_irq_routing_entry *new);
2413+
void kvm_arch_update_irqfd_routing(struct kvm_kernel_irqfd *irqfd,
2414+
struct kvm_kernel_irq_routing_entry *old,
2415+
struct kvm_kernel_irq_routing_entry *new);
24162416
bool kvm_arch_irqfd_route_changed(struct kvm_kernel_irq_routing_entry *,
24172417
struct kvm_kernel_irq_routing_entry *);
24182418
#endif /* CONFIG_HAVE_KVM_IRQ_BYPASS */

virt/kvm/eventfd.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,11 @@ void __attribute__((weak)) kvm_arch_irq_bypass_start(
285285
{
286286
}
287287

288-
int __weak kvm_arch_update_irqfd_routing(struct kvm_kernel_irqfd *irqfd,
289-
struct kvm_kernel_irq_routing_entry *old,
290-
struct kvm_kernel_irq_routing_entry *new)
288+
void __weak kvm_arch_update_irqfd_routing(struct kvm_kernel_irqfd *irqfd,
289+
struct kvm_kernel_irq_routing_entry *old,
290+
struct kvm_kernel_irq_routing_entry *new)
291291
{
292-
return 0;
292+
293293
}
294294

295295
bool __attribute__((weak)) kvm_arch_irqfd_route_changed(
@@ -617,11 +617,8 @@ void kvm_irq_routing_update(struct kvm *kvm)
617617

618618
#if IS_ENABLED(CONFIG_HAVE_KVM_IRQ_BYPASS)
619619
if (irqfd->producer &&
620-
kvm_arch_irqfd_route_changed(&old, &irqfd->irq_entry)) {
621-
int ret = kvm_arch_update_irqfd_routing(irqfd, &old, &irqfd->irq_entry);
622-
623-
WARN_ON(ret);
624-
}
620+
kvm_arch_irqfd_route_changed(&old, &irqfd->irq_entry))
621+
kvm_arch_update_irqfd_routing(irqfd, &old, &irqfd->irq_entry);
625622
#endif
626623
}
627624

0 commit comments

Comments
 (0)