public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] VFIO: Report IOMMU fault event to userspace
@ 2017-02-19 14:47 Lan Tianyu
  2017-02-19 14:47 ` [RFC PATCH 1/3] VFIO: Add new cmd to receive eventfd from userspace to notify IOMMU fault event Lan Tianyu
                   ` (3 more replies)
  0 siblings, 4 replies; 27+ messages in thread
From: Lan Tianyu @ 2017-02-19 14:47 UTC (permalink / raw)
  To: kvm
  Cc: Lan Tianyu, kevin.tian, mst, jan.kiszka, jasowang, peterx, david,
	alex.williamson, yi.l.liu

This patchset proposes a solution to report hardware IOMMU fault
event to userspace. Motivation is to make vIOMMU in Qemu get physical
fault event and info from IOMMU hardware. 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.   

Introduce two new VFIO cmd for VFIO IOMMU type1 driver
- VFIO_IOMMU_SET_FAULT_EVENT_FD
  Receive eventfd from user space and trigger eventfd when get fault event
from IOMMU.  

- VFIO_IOMMU_GET_FAULT_INFO 
  Return IOMMU fault info to userspace.

VFIO IOMMU Type1 driver needs to register IOMMU fault event notifier
to IOMMU driver for assigned devices when they are attached to VFIO
container. IOMMU driver will run VFIO fault event callback when hardware
IOMMU triggers fault events for devices assigned to VFIO container. Then,
type1 driver signals eventfd provided by userspace and usrspace gets fault
info via new cmd.

IOMMU interface are still in design stage and so we still can't register
IOMMU fault event notifier to IOMMU driver. This patchset is prototype
code to check whether VFIO IOMMU type1 driver is suitable place to deal
with IOMMU fault event and just passes build test.

Very appreciate for comments.

Lan Tianyu (3):
  VFIO: Add new cmd to receive eventfd from userspace to notify IOMMU
    fault event
  VFIO: Add IOMMU fault notifier callback
  VFIO: Add new cmd for user space to get IOMMU fault info

 drivers/vfio/vfio_iommu_type1.c | 106 ++++++++++++++++++++++++++++++++++++++++
 include/linux/iommu.h           |   7 +++
 include/uapi/linux/vfio.h       |  37 ++++++++++++++
 3 files changed, 150 insertions(+)

-- 
1.8.3.1

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

end of thread, other threads:[~2017-03-21 23:57 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-19 14:47 [RFC PATCH 0/3] VFIO: Report IOMMU fault event to userspace Lan Tianyu
2017-02-19 14:47 ` [RFC PATCH 1/3] VFIO: Add new cmd to receive eventfd from userspace to notify IOMMU fault event Lan Tianyu
2017-02-20 20:53   ` Alex Williamson
2017-02-21  5:29     ` Lan Tianyu
2017-02-21  5:48   ` Michael S. Tsirkin
2017-02-21  6:05     ` Alex Williamson
2017-02-21  6:11     ` Liu, Yi L
2017-02-19 14:47 ` [RFC PATCH 2/3] VFIO: Add IOMMU fault notifier callback Lan Tianyu
2017-02-20  2:58   ` Liu, Yi L
2017-02-20 20:53   ` Alex Williamson
2017-02-21  6:05     ` Lan Tianyu
2017-02-21  5:55   ` Michael S. Tsirkin
2017-02-21  6:13     ` Lan Tianyu
2017-02-19 14:47 ` [RFC PATCH 3/3] VFIO: Add new cmd for user space to get IOMMU fault info Lan Tianyu
2017-02-20 20:53   ` Alex Williamson
2017-02-20 20:53 ` [RFC PATCH 0/3] VFIO: Report IOMMU fault event to userspace Alex Williamson
2017-02-21  4:49   ` Lan Tianyu
2017-02-21  5:29     ` Alex Williamson
2017-02-21 15:18       ` Lan Tianyu
2017-02-21 15:21         ` Lan, Tianyu
2017-02-28 15:58       ` Lan, Tianyu
2017-03-15  6:17         ` Liu, Yi L
2017-03-15 19:52           ` Alex Williamson
2017-03-16  1:42             ` Lan Tianyu
2017-03-16  3:32               ` Jason Wang
2017-03-16  5:22                 ` Lan Tianyu
2017-03-21 23:57               ` Liu, Yi L

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox