[PATCH 0/5] intel_iommu: Enable PRQ support for passthrough device

Zhenzhong Duan posted 5 patches 6 days, 14 hours ago
Failed in applying to current master (apply log)
hw/i386/intel_iommu_accel.h   |  16 +++
include/hw/i386/intel_iommu.h |   6 +
include/system/iommufd.h      |   7 +-
backends/iommufd.c            |  34 ++++-
hw/arm/smmuv3-accel.c         |   6 +-
hw/i386/intel_iommu.c         |   4 +
hw/i386/intel_iommu_accel.c   | 243 +++++++++++++++++++++++++++++++++-
hw/vfio/iommufd.c             |   2 +-
backends/trace-events         |   3 +-
hw/i386/trace-events          |   2 +
10 files changed, 308 insertions(+), 15 deletions(-)
[PATCH 0/5] intel_iommu: Enable PRQ support for passthrough device
Posted by Zhenzhong Duan 6 days, 14 hours ago
Hi,

When svm=on,pasid=N,x-flst=on is configured for virtual vtd, we enable
guest's support for vSVM. In this case, the host VTD may generate
recoverable first stage page fault event, QEMU read the event and inject
it to guest.

After guest handles the event, it sends a page group response, QEMU gets
the response and pass it to host VTD.

This series adds QEMU support for receiving such host events through the
FAULTQ interface and propagating them to the guest, then catching guest's
responses and propagating them to host.

This patchset depends on pasid support:
https://lore.kernel.org/qemu-devel/20260326091130.321483-1-zhenzhong.duan@intel.com/#t

GIT branch: https://github.com/yiliu1765/qemu/tree/zhenzhong/iommufd_prq

Tests:
Tested with DSA wq attached to an user APP which triggers IO page fault on
process page table durging DMA.

Thanks
Zhenzhong


Zhenzhong Duan (5):
  backends/iommufd: Introduce iommufd_backend_alloc_faultq
  backends/iommufd: Extend iommufd_backend_alloc_hwpt() with fault_id
  intel_iommu_accel: Add PRQ injection for passthrough device
  intel_iommu_accel: Accept PRQ response for passthrough device
  intel_iommu_accel: teardown FAULTQ resources in bottom half

 hw/i386/intel_iommu_accel.h   |  16 +++
 include/hw/i386/intel_iommu.h |   6 +
 include/system/iommufd.h      |   7 +-
 backends/iommufd.c            |  34 ++++-
 hw/arm/smmuv3-accel.c         |   6 +-
 hw/i386/intel_iommu.c         |   4 +
 hw/i386/intel_iommu_accel.c   | 243 +++++++++++++++++++++++++++++++++-
 hw/vfio/iommufd.c             |   2 +-
 backends/trace-events         |   3 +-
 hw/i386/trace-events          |   2 +
 10 files changed, 308 insertions(+), 15 deletions(-)

-- 
2.47.3
RE: [PATCH 0/5] intel_iommu: Enable PRQ support for passthrough device
Posted by Hao, Xudong 6 days, 13 hours ago

> -----Original Message-----
> From: Duan, Zhenzhong <zhenzhong.duan@intel.com>
> Sent: Friday, March 27, 2026 10:52 AM
> To: qemu-devel@nongnu.org
> Cc: alex@shazbot.org; clg@redhat.com; eric.auger@redhat.com;
> mst@redhat.com; jasowang@redhat.com; jgg@nvidia.com;
> nicolinc@nvidia.com; skolothumtho@nvidia.com;
> joao.m.martins@oracle.com; clement.mathieu--drif@bull.com; Tian, Kevin
> <kevin.tian@intel.com>; Liu, Yi L <yi.l.liu@intel.com>; Hao, Xudong
> <xudong.hao@intel.com>; Duan, Zhenzhong <zhenzhong.duan@intel.com>
> Subject: [PATCH 0/5] intel_iommu: Enable PRQ support for passthrough
> device
> 
> Hi,
> 
> When svm=on,pasid=N,x-flst=on is configured for virtual vtd, we enable
> guest's support for vSVM. In this case, the host VTD may generate
> recoverable first stage page fault event, QEMU read the event and inject it to
> guest.
> 
> After guest handles the event, it sends a page group response, QEMU gets
> the response and pass it to host VTD.
> 
> This series adds QEMU support for receiving such host events through the
> FAULTQ interface and propagating them to the guest, then catching guest's
> responses and propagating them to host.
> 
> This patchset depends on pasid support:
> https://lore.kernel.org/qemu-devel/20260326091130.321483-1-
> zhenzhong.duan@intel.com/#t
> 
> GIT branch:
> https://github.com/yiliu1765/qemu/tree/zhenzhong/iommufd_prq
> 
> Tests:
> Tested with DSA wq attached to an user APP which triggers IO page fault on
> process page table durging DMA.
> 
> Thanks
> Zhenzhong
> 
> 
> Zhenzhong Duan (5):
>   backends/iommufd: Introduce iommufd_backend_alloc_faultq
>   backends/iommufd: Extend iommufd_backend_alloc_hwpt() with fault_id
>   intel_iommu_accel: Add PRQ injection for passthrough device
>   intel_iommu_accel: Accept PRQ response for passthrough device
>   intel_iommu_accel: teardown FAULTQ resources in bottom half
> 
>  hw/i386/intel_iommu_accel.h   |  16 +++
>  include/hw/i386/intel_iommu.h |   6 +
>  include/system/iommufd.h      |   7 +-
>  backends/iommufd.c            |  34 ++++-
>  hw/arm/smmuv3-accel.c         |   6 +-
>  hw/i386/intel_iommu.c         |   4 +
>  hw/i386/intel_iommu_accel.c   | 243
> +++++++++++++++++++++++++++++++++-
>  hw/vfio/iommufd.c             |   2 +-
>  backends/trace-events         |   3 +-
>  hw/i386/trace-events          |   2 +
>  10 files changed, 308 insertions(+), 15 deletions(-)
> 
> --
> 2.47.3

Tested-by: Xudong Hao <xudong.hao@intel.com>

DSA PF assignment to VM with vIOMMU scalable mode, userspace test tool dsa_test passed in VM. https://github.com/intel/idxd-config