Skip to contentSkip to conversation

vfio/pci: Restore 8-byte ioeventfd support

PATCH Applied lirongqing 2 participants 2 messages Sep 22 – Sep 29

Subsystems (3)
lore
Share & tools
lore

lirongqing

author
#0 lore raw

PATCH 1/1 vfio/pci: Restore 8-byte ioeventfd support

From: Li RongQing <[email protected]>

Commit b44a06bd28f2 ("vfio/pci: Remove #ifdef iowrite64 and #ifdef ioread64") inadvertently converted a conditional 8-byte rejection into an unconditional one.

Originally, 'count == 8' was rejected only if iowrite64 was undefined (#ifndef iowrite64). When iowrite64 became globally available via generic fallbacks, this rejection became dead code, allowing 8-byte ioeventfds. However, b44a06bd28f2 removed the #ifndef wrappers but left the nested 'if (count == 8) return -EINVAL;' intact, breaking all 8-byte registrations.

Drop the unconditional check to restore 8-byte ioeventfd support, matching the original intent.

Fixes b44a06bd28f2 ("vfio/pci: Remove #ifdef iowrite64 and #ifdef ioread64")
---
 drivers/vfio/pci/vfio_pci_rdwr.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/vfio/pci/vfio_pci_rdwr.c +0 -3
index 7f14dd4..df88480 100644
@@ -423,9 +423,6 @@ int vfio_pci_ioeventfd(struct vfio_pci_core_device *vdev, loff_t offset,
 	      pos >= vdev->msix_offset + vdev->msix_size))
 		return -EINVAL;
 
-	if (count == 8)
-		return -EINVAL;
-
 	io = vfio_pci_core_get_iomap(vdev, bar);
 	if (IS_ERR(io))
 		return PTR_ERR(io);
Signature · 1 line
2.9.4
maintainer Applied
#1 lore raw
Quoted 28 lines · On Tue, 22 Sep 2026 12:00:13 +0800 lirongqing <[email protected]> wrote:

From: Li RongQing <[email protected]>

Commit b44a06bd28f2 ("vfio/pci: Remove #ifdef iowrite64 and #ifdef ioread64") inadvertently converted a conditional 8-byte rejection into an unconditional one.

Originally, 'count == 8' was rejected only if iowrite64 was undefined (#ifndef iowrite64). When iowrite64 became globally available via generic fallbacks, this rejection became dead code, allowing 8-byte ioeventfds. However, b44a06bd28f2 removed the #ifndef wrappers but left the nested 'if (count == 8) return -EINVAL;' intact, breaking all 8-byte registrations.

Drop the unconditional check to restore 8-byte ioeventfd support, matching the original intent.

Fixes b44a06bd28f2 ("vfio/pci: Remove #ifdef iowrite64 and #ifdef ioread64")
---
 drivers/vfio/pci/vfio_pci_rdwr.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/vfio/pci/vfio_pci_rdwr.c +0 -0
index 7f14dd4..df88480 100644

drivers/vfio/pci/vfio_pci_rdwr.c int vfio_pci_ioeventfd(struct vfio_pci_core_device *vdev, loff_t offset, · line 428

Quoted 9 lines
drivers/vfio/pci/vfio_pci_rdwr.c +0 -3
@@ -423,9 +423,6 @@ int vfio_pci_ioeventfd(struct vfio_pci_core_device *vdev, loff_t offset,
 	      pos >= vdev->msix_offset + vdev->msix_size))
 		return -EINVAL;
 
-	if (count == 8)
-		return -EINVAL;
-
 	io = vfio_pci_core_get_iomap(vdev, bar);
 	if (IS_ERR(io))
 		return PTR_ERR(io);

Applied to vfio next branch for v7.4. Thanks!

Alex