** Description changed: + [ Impact ] + + Reading from or writing to 64 bit registers (I/O ports or MMIO) on a PCI + adapter attached via vfio with e.g. the pread()/pwrite() system calls + may not work in case the PCI adapter requires a full read or write that + can not be broken up. + + 64 bit reads/writes are not implemented via the vfio I/O port or MMIO + access, even if the architecture supports 64 bit I/O reads and writes. + + It is necessary to implement the use of 64 bit I/O reads and writes in + the vfio driver, so that such reads and writes are not broken up into + multiple smaller operations if the architecture supports such bigger + operations. + + [ Fix ] + + Backport the following commits in Noble: + - 186bfe44ea41 vfio/pci: Extract duplicated code into macro + - 4df13a6871d9 vfio/pci: Support 8-byte PCI loads and stores + - abe8103da3c5 vfio/pci: Fix typo in macro to declare accessors + + [ Test Case ] + + Bind a PCI device to vfio-pci and open it via /dev/vfio/<group>. + From user space, issue pread()/pwrite() calls with size 64-bit on the device’s registers. + Use ftrace or similar tools to confirm vfio_pci_core_ioread64/vfio_pci_core_iowrite64 is invoked. + If available, check that a device requiring atomic 64-bit access now works correctly. + + [ Regression Potential ] + + The fix affects how VFIO PCI handles 64-bit register accesses via pread() and pwrite() from user-space. + A bug here could cause incorrect or partial reads and writes to device registers, breaking atomicity guarantees required by some PCI adapters. + Users may see devices misconfiguration, inconsistent register values, unexpected hardware behavior, or even system instability when using user-space drivers with VFIO. + + --- + Description: vfio/pci: fix 8-byte PCI loads and stores - Symptom: + Symptom: Reading from or writing to 64 bit registers (I/O ports or MMIO) on a PCI adapter attached via vfio with e.g. the pread()/pwrite() system calls may not work in case the PCI adapter requires a full read or write that can not be broken up. - Problem: + Problem: 64 bit reads/writes are not implemented via the vfio I/O port or MMIO access, even if the architecture supports 64 bit I/O reads and writes. - Solution: + Solution: Implement the use of 64 bit I/O reads and writes in the vfio driver, so that such reads and writes are not broken up into multiple smaller operations if the architecture supports such bigger operations. - Upstream-IDs: + Upstream-IDs: 186bfe44ea41fb38c7a69becd7078724d28cd03c 4df13a6871d9e97aeeef72244e9a954c5cf11f54 Component: kernel
-- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2121146 Title: [UBUNTU 24.04] vfio/pci: fix 8-byte PCI loads and stores To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu-z-systems/+bug/2121146/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
