[PATCH 0/3] vfio: Add DMABUF support for PCI BAR regions

Shameer Kolothum posted 3 patches 1 month, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20251222135357.143339-1-skolothumtho@nvidia.com
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Jason Wang <jasowang@redhat.com>, Alex Williamson <alex@shazbot.org>, "Cédric Le Goater" <clg@redhat.com>, Cornelia Huck <cohuck@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
There is a newer version of this series
hw/net/virtio-net.c                           |  11 +-
hw/vfio/region.c                              |  57 ++-
hw/vfio/trace-events                          |   1 +
include/standard-headers/drm/drm_fourcc.h     |  25 +-
include/standard-headers/linux/ethtool.h      |   5 +
.../linux/input-event-codes.h                 |  14 +-
include/standard-headers/linux/pci_regs.h     |  89 ++++
include/standard-headers/linux/virtio_net.h   |   3 +-
include/standard-headers/linux/virtio_pci.h   |   2 +-
linux-headers/asm-arm64/kvm.h                 |   2 +-
linux-headers/asm-arm64/unistd_64.h           |   1 +
linux-headers/asm-generic/unistd.h            |   4 +-
linux-headers/asm-loongarch/kvm.h             |   1 +
linux-headers/asm-loongarch/unistd.h          |   6 +
linux-headers/asm-loongarch/unistd_64.h       |   1 +
linux-headers/asm-mips/unistd_n32.h           |   1 +
linux-headers/asm-mips/unistd_n64.h           |   1 +
linux-headers/asm-mips/unistd_o32.h           |   1 +
linux-headers/asm-powerpc/unistd_32.h         |   1 +
linux-headers/asm-powerpc/unistd_64.h         |   1 +
linux-headers/asm-riscv/kvm.h                 |   3 +
linux-headers/asm-riscv/unistd_32.h           |   1 +
linux-headers/asm-riscv/unistd_64.h           |   1 +
linux-headers/asm-s390/bitsperlong.h          |   4 -
linux-headers/asm-s390/unistd.h               |   4 -
linux-headers/asm-s390/unistd_32.h            | 446 ------------------
linux-headers/asm-s390/unistd_64.h            |   9 +-
linux-headers/asm-x86/kvm.h                   |   1 +
linux-headers/asm-x86/unistd_32.h             |   1 +
linux-headers/asm-x86/unistd_64.h             |   1 +
linux-headers/asm-x86/unistd_x32.h            |   1 +
linux-headers/linux/iommufd.h                 |  10 +
linux-headers/linux/kvm.h                     |  11 +
linux-headers/linux/mshv.h                    | 116 ++++-
linux-headers/linux/psp-sev.h                 |  66 ++-
linux-headers/linux/vfio.h                    |  28 ++
36 files changed, 427 insertions(+), 503 deletions(-)
delete mode 100644 linux-headers/asm-s390/unistd_32.h
[PATCH 0/3] vfio: Add DMABUF support for PCI BAR regions
Posted by Shameer Kolothum 1 month, 2 weeks ago
Hi,

Linux now provides a VFIO dmabuf exporter to expose PCI BAR memory for P2P
use cases. This adds support for vfio devices to create a dmabuf for
each mapped BAR region.

Requires linux-headers update to 6.19-rc1(patch #1). That update
introduces a virtio-net build issue, which is addressed by patch #2.

The dmabuf support was sanity tested on an NVIDIA grace paltform.

Please take a look and let me know.

Thanks,
Shameer

Nicolin Chen (1):
  hw/vfio/region: Create dmabuf for PCI BAR per region

Shameer Kolothum (2):
  linux-headers: Update to Linux v6.19-rc1
  hw/net/virtio-net: Adapt hash handling to updated UAPI

 hw/net/virtio-net.c                           |  11 +-
 hw/vfio/region.c                              |  57 ++-
 hw/vfio/trace-events                          |   1 +
 include/standard-headers/drm/drm_fourcc.h     |  25 +-
 include/standard-headers/linux/ethtool.h      |   5 +
 .../linux/input-event-codes.h                 |  14 +-
 include/standard-headers/linux/pci_regs.h     |  89 ++++
 include/standard-headers/linux/virtio_net.h   |   3 +-
 include/standard-headers/linux/virtio_pci.h   |   2 +-
 linux-headers/asm-arm64/kvm.h                 |   2 +-
 linux-headers/asm-arm64/unistd_64.h           |   1 +
 linux-headers/asm-generic/unistd.h            |   4 +-
 linux-headers/asm-loongarch/kvm.h             |   1 +
 linux-headers/asm-loongarch/unistd.h          |   6 +
 linux-headers/asm-loongarch/unistd_64.h       |   1 +
 linux-headers/asm-mips/unistd_n32.h           |   1 +
 linux-headers/asm-mips/unistd_n64.h           |   1 +
 linux-headers/asm-mips/unistd_o32.h           |   1 +
 linux-headers/asm-powerpc/unistd_32.h         |   1 +
 linux-headers/asm-powerpc/unistd_64.h         |   1 +
 linux-headers/asm-riscv/kvm.h                 |   3 +
 linux-headers/asm-riscv/unistd_32.h           |   1 +
 linux-headers/asm-riscv/unistd_64.h           |   1 +
 linux-headers/asm-s390/bitsperlong.h          |   4 -
 linux-headers/asm-s390/unistd.h               |   4 -
 linux-headers/asm-s390/unistd_32.h            | 446 ------------------
 linux-headers/asm-s390/unistd_64.h            |   9 +-
 linux-headers/asm-x86/kvm.h                   |   1 +
 linux-headers/asm-x86/unistd_32.h             |   1 +
 linux-headers/asm-x86/unistd_64.h             |   1 +
 linux-headers/asm-x86/unistd_x32.h            |   1 +
 linux-headers/linux/iommufd.h                 |  10 +
 linux-headers/linux/kvm.h                     |  11 +
 linux-headers/linux/mshv.h                    | 116 ++++-
 linux-headers/linux/psp-sev.h                 |  66 ++-
 linux-headers/linux/vfio.h                    |  28 ++
 36 files changed, 427 insertions(+), 503 deletions(-)
 delete mode 100644 linux-headers/asm-s390/unistd_32.h

-- 
2.43.0
Re: [PATCH 0/3] vfio: Add DMABUF support for PCI BAR regions
Posted by Cédric Le Goater 1 month, 2 weeks ago
Hi Shameer,

On 12/22/25 14:53, Shameer Kolothum wrote:
> Hi,
> 
> Linux now provides a VFIO dmabuf exporter to expose PCI BAR memory for P2P
> use cases. This adds support for vfio devices to create a dmabuf for
> each mapped BAR region.
> 
> Requires linux-headers update to 6.19-rc1(patch #1). That update
> introduces a virtio-net build issue, which is addressed by patch #2.
> 
> The dmabuf support was sanity tested on an NVIDIA grace paltform.
> 
> Please take a look and let me know.

I gave it a try with a pair of GPUs on x86_64. LGTM.

It should be ready to merge after the linux-headers update
is fixed.

Thanks,

C.


> 
> Thanks,
> Shameer
> 
> Nicolin Chen (1):
>    hw/vfio/region: Create dmabuf for PCI BAR per region
> 
> Shameer Kolothum (2):
>    linux-headers: Update to Linux v6.19-rc1
>    hw/net/virtio-net: Adapt hash handling to updated UAPI
> 
>   hw/net/virtio-net.c                           |  11 +-
>   hw/vfio/region.c                              |  57 ++-
>   hw/vfio/trace-events                          |   1 +
>   include/standard-headers/drm/drm_fourcc.h     |  25 +-
>   include/standard-headers/linux/ethtool.h      |   5 +
>   .../linux/input-event-codes.h                 |  14 +-
>   include/standard-headers/linux/pci_regs.h     |  89 ++++
>   include/standard-headers/linux/virtio_net.h   |   3 +-
>   include/standard-headers/linux/virtio_pci.h   |   2 +-
>   linux-headers/asm-arm64/kvm.h                 |   2 +-
>   linux-headers/asm-arm64/unistd_64.h           |   1 +
>   linux-headers/asm-generic/unistd.h            |   4 +-
>   linux-headers/asm-loongarch/kvm.h             |   1 +
>   linux-headers/asm-loongarch/unistd.h          |   6 +
>   linux-headers/asm-loongarch/unistd_64.h       |   1 +
>   linux-headers/asm-mips/unistd_n32.h           |   1 +
>   linux-headers/asm-mips/unistd_n64.h           |   1 +
>   linux-headers/asm-mips/unistd_o32.h           |   1 +
>   linux-headers/asm-powerpc/unistd_32.h         |   1 +
>   linux-headers/asm-powerpc/unistd_64.h         |   1 +
>   linux-headers/asm-riscv/kvm.h                 |   3 +
>   linux-headers/asm-riscv/unistd_32.h           |   1 +
>   linux-headers/asm-riscv/unistd_64.h           |   1 +
>   linux-headers/asm-s390/bitsperlong.h          |   4 -
>   linux-headers/asm-s390/unistd.h               |   4 -
>   linux-headers/asm-s390/unistd_32.h            | 446 ------------------
>   linux-headers/asm-s390/unistd_64.h            |   9 +-
>   linux-headers/asm-x86/kvm.h                   |   1 +
>   linux-headers/asm-x86/unistd_32.h             |   1 +
>   linux-headers/asm-x86/unistd_64.h             |   1 +
>   linux-headers/asm-x86/unistd_x32.h            |   1 +
>   linux-headers/linux/iommufd.h                 |  10 +
>   linux-headers/linux/kvm.h                     |  11 +
>   linux-headers/linux/mshv.h                    | 116 ++++-
>   linux-headers/linux/psp-sev.h                 |  66 ++-
>   linux-headers/linux/vfio.h                    |  28 ++
>   36 files changed, 427 insertions(+), 503 deletions(-)
>   delete mode 100644 linux-headers/asm-s390/unistd_32.h
>
Re: [PATCH 0/3] vfio: Add DMABUF support for PCI BAR regions
Posted by Nicolin Chen 1 month, 2 weeks ago
On Mon, Dec 22, 2025 at 01:53:54PM +0000, Shameer Kolothum wrote:
> Linux now provides a VFIO dmabuf exporter to expose PCI BAR memory for P2P
> use cases. This adds support for vfio devices to create a dmabuf for
> each mapped BAR region.
> 
> Requires linux-headers update to 6.19-rc1(patch #1). That update
> introduces a virtio-net build issue, which is addressed by patch #2.
> 
> The dmabuf support was sanity tested on an NVIDIA grace paltform.
> 
> Please take a look and let me know.
 
Tested-by: Nicolin Chen <nicolinc@nvidia.com>