APPLIED: [SRU][N][PATCH 0/1] [UBUNTU 24.04] vfio/pci: fix 8-byte PCI loads and stores (LP: #2121146)

Stefan Bader stefan.bader at canonical.com
Fri Sep 12 10:04:15 UTC 2025


On 28/08/2025 14:53, Massimiliano Pellizzer wrote:
> BugLink: https://bugs.launchpad.net/bugs/2121146
> 
> [ 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.
> 
> 


Applied to noble:linux/master-next. Thanks.

-Stefan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xE8675DEECBEECEA3.asc
Type: application/pgp-keys
Size: 48643 bytes
Desc: OpenPGP public key
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20250912/f920d4b3/attachment-0001.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20250912/f920d4b3/attachment-0001.sig>


More information about the kernel-team mailing list