]> git.proxmox.com Git - mirror_qemu.git/commit - memory.c
memory: introduce IOMMUNotifier and its caps
authorPeter Xu <peterx@redhat.com>
Fri, 23 Sep 2016 05:02:26 +0000 (13:02 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 27 Sep 2016 06:59:16 +0000 (08:59 +0200)
commitcdb3081269347fd9271fd1b7a9df312e2953bdd9
treeb9eb019b24ce2ebd5c849f513975960ed4c2abfd
parent7cfdc02dae0d2ff58c897496cfdbbafc0eda0f3f
memory: introduce IOMMUNotifier and its caps

IOMMU Notifier list is used for notifying IO address mapping changes.
Currently VFIO is the only user.

However it is possible that future consumer like vhost would like to
only listen to part of its notifications (e.g., cache invalidations).

This patch introduced IOMMUNotifier and IOMMUNotfierFlag bits for a
finer grained control of it.

IOMMUNotifier contains a bitfield for the notify consumer describing
what kind of notification it is interested in. Currently two kinds of
notifications are defined:

- IOMMU_NOTIFIER_MAP:    for newly mapped entries (additions)
- IOMMU_NOTIFIER_UNMAP:  for entries to be removed (cache invalidates)

When registering the IOMMU notifier, we need to specify one or multiple
types of messages to listen to.

When notifications are triggered, its type will be checked against the
notifier's type bits, and only notifiers with registered bits will be
notified.

(For any IOMMU implementation, an in-place mapping change should be
 notified with an UNMAP followed by a MAP.)

Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <1474606948-14391-2-git-send-email-peterx@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/vfio/common.c
include/exec/memory.h
include/hw/vfio/vfio-common.h
memory.c