On 1/16/26 10:29, Shameer Kolothum wrote:
From: Nicolin Chen <[email protected]>

Linux now provides a VFIO dmabuf exporter to expose PCI BAR memory for P2P
use cases. Create a dmabuf for each mapped BAR region after the mmap is set
up, and store the returned fd in the region’s RAMBlock. This allows QEMU to
pass the fd to dma_map_file(), enabling iommufd to import the dmabuf and map
the BAR correctly in the host IOMMU page table.

If the kernel lacks support or dmabuf setup fails, QEMU skips the setup
and continues with normal mmap handling.

Tested-by: Nicolin Chen <[email protected]>
Reviewed-by: Zhenzhong Duan <[email protected]>
Signed-off-by: Nicolin Chen <[email protected]>
Signed-off-by: Shameer Kolothum <[email protected]>
---
  hw/vfio/region.c     | 65 +++++++++++++++++++++++++++++++++++++++++++-
  hw/vfio/trace-events |  1 +
  2 files changed, 65 insertions(+), 1 deletion(-)

Reviewed-by: Cédric Le Goater <[email protected]>


Thanks,

C.


Reply via email to