@samitouri / QOSamiQemu / commits / f48f2011fd

accel/mshv: use s->irq_routes in commit_routes

In mshv_irqchip_commit_routes() the entries that have been accumulated in s->irq_routes are committed directly to MSHV's irqchip. The old commit_msi_routing_table() fn will be removed in a subsquent commit. Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com> Link: https://lore.kernel.org/r/20260417105618.3621-12-magnuskulke@linux.microsoft.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Magnus Kulke committed Apr 17, 2026 at 12:55 UTC f48f2011fd1299b903180e3465055e3a0231eb76
4 files changed +7 -6
accel/accel-irq.c
+1 -1
@@ -55,7 +55,7 @@ void accel_irqchip_commit_routes(void)
55 {
56 #ifdef CONFIG_MSHV_IS_POSSIBLE
57 if (mshv_msi_via_irqfd_enabled()) {
58 - mshv_irqchip_commit_routes();
58 + mshv_irqchip_commit_routes(mshv_state);
59 }
60 #endif
61 if (kvm_enabled()) {
accel/mshv/irq.c
+4 -3
@@ -394,16 +394,17 @@ int mshv_request_interrupt(MshvState *mshv_state, uint32_t interrupt_type, uint3
394 return 0;
395 }
396
397 -void mshv_irqchip_commit_routes(void)
397 +void mshv_irqchip_commit_routes(MshvState *s)
398 {
399 int ret;
400 - int vm_fd = mshv_state->vm;
400 + int vm_fd = s->vm;
401
402 - ret = commit_msi_routing_table(vm_fd);
402 + ret = ioctl(vm_fd, MSHV_SET_MSI_ROUTING, s->irq_routes);
403 if (ret < 0) {
404 error_report("Failed to commit msi routing table");
405 abort();
406 }
407 + trace_mshv_commit_msi_routing_table(vm_fd, s->irq_routes->nr);
408 }
409
410 int mshv_irqchip_add_irqfd_notifier_gsi(const EventNotifier *event,
accel/stubs/mshv-stub.c
+1 -1
@@ -28,7 +28,7 @@ int mshv_irqchip_update_msi_route(int virq, MSIMessage msg, PCIDevice *dev)
28 return -ENOSYS;
29 }
30
31 -void mshv_irqchip_commit_routes(void)
31 +void mshv_irqchip_commit_routes(MshvState *s)
32 {
33 }
34
include/system/mshv.h
+1 -1
@@ -62,8 +62,8 @@ int mshv_request_interrupt(MshvState *mshv_state, uint32_t interrupt_type, uint3
62
63 int mshv_irqchip_add_msi_route(AccelRouteChange *c, int vector, PCIDevice *dev);
64 int mshv_irqchip_update_msi_route(int virq, MSIMessage msg, PCIDevice *dev);
65 -void mshv_irqchip_commit_routes(void);
65 void mshv_irqchip_release_virq(MshvState *s, int virq);
66 +void mshv_irqchip_commit_routes(MshvState *s);
67 int mshv_irqchip_add_irqfd_notifier_gsi(const EventNotifier *n,
68 const EventNotifier *rn, int virq);
69 int mshv_irqchip_remove_irqfd_notifier_gsi(const EventNotifier *n, int virq);