From 67aa6c18bccd4ba24cfc925f35b07813e00805e5 Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Wed, 4 Feb 2026 17:18:28 +0800 Subject: [PATCH] anolis: vfio/pci: Fix VFIO_DEVICE_GET_IRQ_INFO to return correct flags ANBZ: #30544 MSI-x in device passthrough fails. QEMU reports errors: qemu-system-x86_64: vfio 0000:43:00.0: Failed to set up TRIGGER eventfd signaling for interrupt MSIX-1: VFIO_DEVICE_SET_IRQS failure: Invalid argument The VFIO_DEVICE_GET_IRQ_INFO ioctl must report VFIO_IRQ_INFO_NORESIZE for MSI-x as the current msi domain does not support dynamic vector allocation after MSI-x has been enabled. However, the handler incorrectly overwrites info.flags with VFIO_IRQ_INFO_EVENTFD after the initial flag setup, dropping VFIO_IRQ_INFO_NORESIZE and any other flags previously set. As a result, QEMU believes the MSI-x vector count is resizable and issues VFIO_DEVICE_SET_IRQS operations that the kernel rejects with -EINVAL. Remove the incorrect flags reset so that all required IRQ info flags are returned to userspace. Hygon-SIG: commit none hygon vfio/pci: Fix VFIO_DEVICE_GET_IRQ_INFO to return correct flags Fixes: 2c2a9b87fd3e ("vfio/pci: Add framework for custom interrupt indices") Signed-off-by: Wei Wang Cc: hygon-arch@list.openanolis.cn --- drivers/vfio/pci/vfio_pci_core.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c index 1423a5916e0e..644173af0572 100644 --- a/drivers/vfio/pci/vfio_pci_core.c +++ b/drivers/vfio/pci/vfio_pci_core.c @@ -1210,8 +1210,6 @@ long vfio_pci_core_ioctl(struct vfio_device *core_vdev, unsigned int cmd, } } - info.flags = VFIO_IRQ_INFO_EVENTFD; - info.count = vfio_pci_get_irq_count(vdev, info.index); if (caps.size) { -- Gitee