All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v8 0/6] intel_iommu: Enable PRQ support for passthrough device
@ 2026-10-09  9:07 Zhenzhong Duan
  2026-10-09  9:07 ` [PATCH v8 1/6] intel_iommu_accel: Guard VTDAccelPASIDCacheEntry definition Zhenzhong Duan
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Zhenzhong Duan @ 2026-10-09  9:07 UTC (permalink / raw)
  To: qemu-devel
  Cc: alex, clg, eric.auger, mst, jasowangio, jgg, nicolinc,
	skolothumtho, joao.m.martins, clement.mathieu--drif, kevin.tian,
	yi.l.liu, Zhenzhong Duan

Hi,

When svm=on,pasid-bits=N,fsts=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.

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

Tests:
Tested with DSA wq attached to an user APP which triggers IO page fault on
process page table durging DMA.
Build test with window cross-build.

Thanks
Zhenzhong

Changelog:
v8:
- s/sizeof(IOMMUFaultQueue)/sizeof(*fq) (Clement)

v7:
- add trailing "s" to vtd_propagate_recoverable_fault() name (Clement)
- s/fault/faults/ for array fault[FAULTQ_BUF_SIZE] (Clement)
- s/'ssize_t bytes'/'ssize_t ret' for trace_vtd_[read|write]_fs_faultq() input (Clement)
- switch to designated initialization for variable resp (Clement)

v6:
- further polish doc comments for vtd_pri_request_page (Liuyi)
- set FAULTQ_BUF_SIZE to 2048 to avoid prq lost (Liuyi)
- move PRE validation hunk in the caller side (Liuyi)
- add break in vtd_prq_list search loop in vtd_prq_response_notify (Clement)
- s/vtd_prq_report_fault/vtd_propagate_recoverable_fault (Liuyi, Clement)
- s/vtd_prq_read_fault/vtd_read_fs_faultq (Liuyi)
- s/vtd_prq_write_response/vtd_write_fs_faultq
- s/vtd_prq_response_notify/vtd_prq_handle_pasid_response

v5:
- add comment "Accept the PCI PASID as input" to docstring of function vtd_pri_request_page (Clement)
- change vtd_prq_report_fault() parameter type "int cnt" -> "unsigned cnt" (Clement)
- check return value of vtd_pri_request_page() and send response (Clement)
- free all vtd_prq_list entries when detaching (Clement)

v4:
- add the comment to the docstring of the function vtd_prq_report_fault itself (Clement)
- add "out_" prefix for fault_id & fault_fd output parameter (Clement)

v3:
- convert to PCI pasid before passing to vtd_pri_request_page (Clement)
- expose vtd_pri_request_page and drop accel_ops pointer (Clement)
- add a cleanup patch "intel_iommu_accel: Guard VTDAccelPASIDCacheEntry definition" (Philippe)

v2:
- define fault_fd int type (Liuyi)
- update comments on FAULTQ_BUF_SIZE (Liuyi)
- drop param vtd_hiod in vtd_destroy_old_fs_faultq() (Liuyi)
- s/vtd_propagate_page_group_response_accel/vtd_accel_propagate_page_group_response (Liuyi)
- call vtd_prq_response_notify() directly instead of through pri_notifier (Liuyi)
- replace "fault_id != 0" check with "fault_fd < 0" check (Liuyi)

Zhenzhong Duan (6):
  intel_iommu_accel: Guard VTDAccelPASIDCacheEntry definition
  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 +-
 hw/i386/intel_iommu_internal.h |   3 +
 include/hw/i386/intel_iommu.h  |   6 +
 include/system/iommufd.h       |   7 +-
 backends/iommufd.c             |  28 +++-
 hw/arm/smmuv3-accel.c          |   6 +-
 hw/i386/intel_iommu.c          |  18 ++-
 hw/i386/intel_iommu_accel.c    | 282 ++++++++++++++++++++++++++++++++-
 hw/vfio/iommufd.c              |   2 +-
 backends/trace-events          |   3 +-
 hw/i386/trace-events           |   2 +
 11 files changed, 351 insertions(+), 22 deletions(-)

-- 
2.52.0



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-10-09 20:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-09  9:07 [PATCH v8 0/6] intel_iommu: Enable PRQ support for passthrough device Zhenzhong Duan
2026-10-09  9:07 ` [PATCH v8 1/6] intel_iommu_accel: Guard VTDAccelPASIDCacheEntry definition Zhenzhong Duan
2026-10-09  9:07 ` [PATCH v8 2/6] backends/iommufd: Introduce iommufd_backend_alloc_faultq Zhenzhong Duan
2026-10-09 20:24   ` Nicolin Chen
2026-10-09  9:07 ` [PATCH v8 3/6] backends/iommufd: Extend iommufd_backend_alloc_hwpt() with fault_id Zhenzhong Duan
2026-10-09 20:26   ` Nicolin Chen
2026-10-09  9:07 ` [PATCH v8 4/6] intel_iommu_accel: Add PRQ injection for passthrough device Zhenzhong Duan
2026-10-09  9:07 ` [PATCH v8 5/6] intel_iommu_accel: Accept PRQ response " Zhenzhong Duan
2026-10-09  9:07 ` [PATCH v8 6/6] intel_iommu_accel: teardown FAULTQ resources in bottom half Zhenzhong Duan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.