Skip to content

RFC VT-d: Inject fault event from IOMMU hardware

Lan Tianyu qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 of 4 patches 3 repliesIn review

3 of 4 patches are in this archive. The cover letter announces 4.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4VFIO: Set eventfd for IOMMU fault event via new vfio cmdhw/vfio/common.c include/hw/vfio/vfio-common.h linux-headers/linux/vfio.h+53 -01 reply
3/4Intel iommu: Add Intel IOMMU fault event callbackhw/i386/intel_iommu.c+25 -01 reply
4/4VFIO: Read IOMMU fault info from kernel space when get fault eventhw/vfio/common.c linux-headers/linux/vfio.h+73 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [Resend RFC PATCH 0/4] VT-d: Inject fault event from IOMMU hardware

Resend patchset due to wrong Qemu devel mail address. Sorry for noise.

This patchset proposes a solution for vIOMMU to get hardware IOMMU fault event and info. Motivation is to make vIOMMU inject associated fault event when pIOMMU reports fault event. vIOMMU is in charge of transforming fault info and inject to guest. The feature is also very important to support first level translation(Translation request with PASID) in VM which requires vIOMMU to inject device page request to VM.

VFIO can get notification and read fault info via new VFIO cmds. Add fault event handler in the memory IOMMU ops and Intel IOMMU device model needs to register its fault event callback. VFIO will call the callback via memory wrapper function when get fault notification.

This patches is prototype code and just passes build test. IOMMU driver new interface is still in the design stage. This patches is to confirm interface between Qemu and VFIO kernel driver is on the right way.

Very appreciate for comments.

Lan Tianyu (4):
VFIO: Set eventfd for IOMMU fault event via new vfio cmd
Memory: Introduce IOMMU fault event callback
Intel iommu: Add Intel IOMMU fault event callback
VFIO: Read IOMMU fault info from kernel space when get fault event

 hw/i386/intel_iommu.c         | 25 ++++++++++++
 hw/vfio/common.c              | 88 +++++++++++++++++++++++++++++++++++++++++++
 include/exec/memory.h         | 19 ++++++++++
 include/hw/vfio/vfio-common.h |  3 ++
 linux-headers/linux/vfio.h    | 35 +++++++++++++++++
 memory.c                      |  8 ++++
 6 files changed, 178 insertions(+)
Signature · 1 line
1.8.3.1