Skip to content

Introduce IOMMUNotifier struct

Peter Xu qemu-devel 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest3 patches 3 repliesIn review
  2. v63 patches 8 repliesSuperseded
  3. v53 patches 10 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v43 patches14 repliesSuperseded
v33 patches11 repliesSuperseded
v23 patches2 repliesSuperseded

Changes in v7 from the cover letter

- add comments to memory_region_notify_iommu() to better clarify the interface [David]
- vfio_iommu_map_notify(): remove pointless "IOMMUTLBEntry *iotlb = data" [David]
- typo fix on English [David]

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3memory: introduce IOMMUNotifier and its capshw/vfio/common.c include/exec/memory.h include/hw/vfio/vfio-common.h +1 more+71 -191 reply
2/3memory: introduce IOMMUOps.notify_flag_changedhw/i386/intel_iommu.c hw/ppc/spapr_iommu.c include/exec/memory.h +1 more+40 -220 replies
3/3intel_iommu: allow UNMAP notifiershw/i386/intel_iommu.c+8 -40 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchDavid Gibson
1/3R-b
2/3A-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v7 thread

Cover letter [Qemu-devel] [PATCH v7 0/3] Introduce IOMMUNotifier struct

V7:
- add comments to memory_region_notify_iommu() to better clarify the interface [David]
- vfio_iommu_map_notify(): remove pointless "IOMMUTLBEntry *iotlb = data" [David]
- typo fix on English [David]

V6:
- use IOMMUTLBEntry directly for IOMMUNotifier.notify() [David]
- add explicit comment for patch 1 that CHANGE should be treated as a MAP then an UNMAP [David]
- add a-b for David on patch 2

V5:
- squash spapr_tce_notify_{started|stopped} into spapr_tce_notify_flag_changed [David]
- in spapr_tce_notify_flag_changed: check flags against "!= IOMMU_NOTIFIER_NONE", but not "== IOMMU_NOTIFIER_ALL" [David]
- add r-b for David on patch 3

V4:
- change "notifier_caps" into "notifier_flags" [David]
- rename IOMMU_NOTIFIER_{CHANGE|INVALIDATION} with MAP/UNMAP [David]
- introduce IOMMUOps.notify_flag_changed, to replace notify_started and notify_stopped [David, Paolo]

V3:
- use QLIST instead of embedding Notifier into IOMMUNotifier [Paolo]
- fix a build error for ppc64-softmmu

The idea originates from one of Alex's reply:

https://lists.gnu.org/archive/html/qemu-devel/2016-09/msg00254.html

But after further discussions, it seems that only adding a simple type for notifier is not enough. This series introduced IOMMUNotifier struct to replace the old Notifier interface. Along with it, we can provide registration for one (or multiple) of the IOMMU notifications:

- cache invalidations
- entry changes

This is a support material for Jason's vhost dmar patchset.

Please read commit messages for detailed information. Thanks,

Peter Xu (3):
memory: introduce IOMMUNotifier and its caps
memory: introduce IOMMUOps.notify_flag_changed
intel_iommu: allow UNMAP notifiers

 hw/i386/intel_iommu.c         | 18 ++++++++-----
 hw/ppc/spapr_iommu.c          | 18 +++++++------
 hw/vfio/common.c              |  4 +--
 include/exec/memory.h         | 56 ++++++++++++++++++++++++++++++++--------
 include/hw/vfio/vfio-common.h |  2 +-
 memory.c                      | 60 +++++++++++++++++++++++++++++++++----------
 6 files changed, 116 insertions(+), 42 deletions(-)
Signature · 1 line
2.7.4