All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 00/10] hw/vfio, x86/iommu: IOMMUFD Dirty Tracking
@ 2022-04-28 21:13 ` Joao Martins
  0 siblings, 0 replies; 37+ messages in thread
From: Joao Martins @ 2022-04-28 21:13 UTC (permalink / raw)
  To: qemu-devel
  Cc: Joao Martins, Paolo Bonzini, Dr. David Alan Gilbert,
	Richard Henderson, Eduardo Habkost, Michael S. Tsirkin,
	Marcel Apfelbaum, Peter Xu, Jason Wang, Alex Williamson,
	David Hildenbrand, Philippe Mathieu-Daudé,
	Cornelia Huck, Juan Quintela, Eric Blake, Markus Armbruster,
	Jason Gunthorpe, Nicolin Chen, Yishai Hadas, Kevin Tian, Yi Liu,
	Eric Auger, Thanos Makatos, John G . Johnson, kvm

This series expands IOMMUFD series from Yi and Eric into
supporting IOMMU Dirty Tracking. It adds both the emulated x86
IOMMUs, as well as IOMMUFD support that exercises said
emulation (or H/W).

It is organized into:

* Patches 1 - 4: x86 IOMMU emulation that performs dirty tracking,
useful for a nested guest exercising the IOMMUFD kernel counterpart
for coverage and development. The caching of the PASID PTE root flags
and AMD DTE is not exactly the cleanest, still wondering about a
better way without having to lookup context/DTE prior to IOTLB lookup.

* Patches 5 - 9: IOMMUFD backend support for dirty tracking;
Sadly this wasn't exactly tested with VF Live Migration, but it adds
(last 2 patches) a way to measure dirty rate via HMP and QMP.

The IOMMUFD kernel patches go into extent on what each of the ioctls
do, albeit the workflow is relatively simple:

 1) Toggling dirty tracking via HWPT_SET_DIRTY or get -ENOTSUPP otherwise
    which voids any attempt of walking IO pagetables

 2) Read-and-clear of Dirty IOVAs

 3) Unmap vIOMMU-backed IOVAs and fetch its dirty state right-before-unmap.

The series is still a WIP. The intend is to exercise the kernel side[0]
aside from the selftests that provide some coverage.

Comments, feedback, as always appreciated.

	Joao

[0] https://lore.kernel.org/linux-iommu/20220428210933.3583-1-joao.m.martins@oracle.com/

Joao Martins (10):
  amd-iommu: Cache PTE/DTE info in IOTLB
  amd-iommu: Access/Dirty bit support
  intel-iommu: Cache PASID entry flags
  intel_iommu: Second Stage Access Dirty bit support
  linux-headers: import iommufd.h hwpt extensions
  vfio/iommufd: Add HWPT_SET_DIRTY support
  vfio/iommufd: Add HWPT_GET_DIRTY_IOVA support
  vfio/iommufd: Add IOAS_UNMAP_DIRTY support
  migration/dirtyrate: Expand dirty_bitmap to be tracked separately for
    devices
  hw/vfio: Add nr of dirty pages to tracepoints

 accel/kvm/kvm-all.c            |  12 +++
 hmp-commands.hx                |   5 +-
 hw/i386/amd_iommu.c            |  76 +++++++++++++-
 hw/i386/amd_iommu.h            |  11 +-
 hw/i386/intel_iommu.c          | 103 +++++++++++++++++--
 hw/i386/intel_iommu_internal.h |   4 +
 hw/i386/trace-events           |   4 +
 hw/iommufd/iommufd.c           |  63 ++++++++++++
 hw/iommufd/trace-events        |   3 +
 hw/vfio/container.c            |  20 +++-
 hw/vfio/iommufd.c              | 179 ++++++++++++++++++++++++++++++++-
 hw/vfio/trace-events           |   3 +-
 include/exec/memory.h          |  10 +-
 include/hw/i386/intel_iommu.h  |   1 +
 include/hw/iommufd/iommufd.h   |   6 ++
 linux-headers/linux/iommufd.h  |  78 ++++++++++++++
 migration/dirtyrate.c          |  59 ++++++++---
 migration/dirtyrate.h          |   1 +
 qapi/migration.json            |  15 +++
 softmmu/memory.c               |   5 +
 20 files changed, 618 insertions(+), 40 deletions(-)

-- 
2.17.2


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

end of thread, other threads:[~2022-05-05  9:57 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-28 21:13 [PATCH RFC 00/10] hw/vfio, x86/iommu: IOMMUFD Dirty Tracking Joao Martins
2022-04-28 21:13 ` Joao Martins
2022-04-28 21:13 ` [PATCH RFC 01/10] amd-iommu: Cache PTE/DTE info in IOTLB Joao Martins
2022-04-28 21:13   ` Joao Martins
2022-04-28 21:13 ` [PATCH RFC 02/10] amd-iommu: Access/Dirty bit support Joao Martins
2022-04-28 21:13   ` Joao Martins
2022-04-28 21:13 ` [PATCH RFC 03/10] intel-iommu: Cache PASID entry flags Joao Martins
2022-04-28 21:13   ` Joao Martins
2022-04-28 21:13 ` [PATCH RFC 04/10] intel_iommu: Second Stage Access Dirty bit support Joao Martins
2022-04-28 21:13   ` Joao Martins
2022-04-29  2:26   ` Jason Wang
2022-04-29  2:26     ` Jason Wang
2022-04-29  9:12     ` Joao Martins
2022-04-29  9:12       ` Joao Martins
2022-04-29 18:21       ` Peter Xu
2022-04-29 18:21         ` Peter Xu
2022-05-03 11:54         ` Joao Martins
2022-05-05  7:41           ` Jason Wang
2022-05-05  9:57             ` Joao Martins
2022-05-04 20:11   ` Peter Xu
2022-05-05  9:54     ` Joao Martins
2022-04-28 21:13 ` [PATCH RFC 05/10] linux-headers: import iommufd.h hwpt extensions Joao Martins
2022-04-28 21:13   ` Joao Martins
2022-04-28 21:13 ` [PATCH RFC 06/10] vfio/iommufd: Add HWPT_SET_DIRTY support Joao Martins
2022-04-28 21:13   ` Joao Martins
2022-04-28 21:13 ` [PATCH RFC 07/10] vfio/iommufd: Add HWPT_GET_DIRTY_IOVA support Joao Martins
2022-04-28 21:13   ` Joao Martins
2022-04-28 21:13 ` [PATCH RFC 08/10] vfio/iommufd: Add IOAS_UNMAP_DIRTY support Joao Martins
2022-04-28 21:13   ` Joao Martins
2022-04-28 21:13 ` [PATCH RFC 09/10] migration/dirtyrate: Expand dirty_bitmap to be tracked separately for devices Joao Martins
2022-04-28 21:13   ` Joao Martins
2022-05-02 12:54   ` Markus Armbruster
2022-05-02 12:54     ` Markus Armbruster
2022-05-02 14:35     ` Joao Martins
2022-05-02 14:35       ` Joao Martins
2022-04-28 21:13 ` [PATCH RFC 10/10] hw/vfio: Add nr of dirty pages to tracepoints Joao Martins
2022-04-28 21:13   ` Joao Martins

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.