From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: tianyu.lan@intel.com, Paolo Bonzini <pbonzini@redhat.com>,
kevin.tian@intel.com, yi.l.liu@intel.com, peterx@redhat.com,
Jason Wang <jasowang@redhat.com>,
David Gibson <david@gibson.dropbear.id.au>,
Alex Williamson <alex.williamson@redhat.com>
Subject: [Qemu-devel] [RFC PATCH 0/8] IOMMU: introduce common IOMMUObject
Date: Thu, 27 Apr 2017 17:34:12 +0800 [thread overview]
Message-ID: <1493285660-4470-1-git-send-email-peterx@redhat.com> (raw)
>From time to time, I was always thinking whether we should have a
IOMMU object in common, not depending on platform (x86/ppc/...), or
bus (PCI/...). Virt-svm is a case that may use it now - it needs to
register some notifiers so that when some event triggered the callback
can be invoked. However current MemoryRegion IOMMU notifiers do not
suite well with that purpose, since the notifiers are mostly binded to
memory regions and tailored to IOTLB notifications, while for virt-svm
it should be listening to one IOMMU device, rather than a specific
memory region.
This series tried to do several things:
- renaming old "iommu notifiers" into "iotlb notifiers", to avoid
confusion of what it is used for
- introduce a way to fetch an IOMMU object from a device DMA address
space (for x86, it should be a pci device)
- introduce a common IOMMU object, along with a similar notifier
mechanism for it
There is a use-case example in the last patch to show how to use it,
on how to modify customized IOMMU device to have such a common object,
and on how to use the notifiers (merely the same as old one).
If with luck, this series can be a pre-requisite for the following
patchset:
[RFC PATCH 00/20] Qemu: Extend intel_iommu emulator to support
Shared Virtual Memory
But before that, looking forward to any of your comments.
Test done: compile test only.
Please kindly review. Thanks.
Peter Xu (8):
memory: rename IOMMU_NOTIFIER_*
memory: rename IOMMUNotifier
memory: rename iommu_notifier_init()
memory: rename *_notify_iommu*
memory: rename *iommu_notifier*
memory: introduce AddressSpaceOps
intel_iommu: provide AddressSpaceOps.iommu_get()
iommu: introduce hw/core/iommu
hw/core/Makefile.objs | 1 +
hw/core/iommu.c | 61 +++++++++++++++++++++++++++++
hw/i386/amd_iommu.c | 6 +--
hw/i386/intel_iommu.c | 47 +++++++++++++---------
hw/ppc/spapr_iommu.c | 10 ++---
hw/s390x/s390-pci-inst.c | 2 +-
hw/vfio/common.c | 16 ++++----
hw/virtio/vhost.c | 14 +++----
include/exec/memory.h | 91 +++++++++++++++++++++++++++----------------
include/hw/core/iommu.h | 72 ++++++++++++++++++++++++++++++++++
include/hw/i386/intel_iommu.h | 10 +++--
include/hw/vfio/vfio-common.h | 2 +-
include/hw/virtio/vhost.h | 4 +-
memory.c | 54 ++++++++++++++-----------
14 files changed, 283 insertions(+), 107 deletions(-)
create mode 100644 hw/core/iommu.c
create mode 100644 include/hw/core/iommu.h
--
2.7.4
next reply other threads:[~2017-04-27 9:34 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-27 9:34 Peter Xu [this message]
2017-04-27 9:34 ` [Qemu-devel] [RFC PATCH 1/8] memory: rename IOMMU_NOTIFIER_* Peter Xu
2017-05-01 4:50 ` David Gibson
2017-04-27 9:34 ` [Qemu-devel] [RFC PATCH 2/8] memory: rename IOMMUNotifier Peter Xu
2017-05-01 4:51 ` David Gibson
2017-04-27 9:34 ` [Qemu-devel] [RFC PATCH 3/8] memory: rename iommu_notifier_init() Peter Xu
2017-05-01 4:53 ` David Gibson
2017-05-08 5:50 ` Peter Xu
2017-04-27 9:34 ` [Qemu-devel] [RFC PATCH 4/8] memory: rename *_notify_iommu* Peter Xu
2017-05-01 4:55 ` David Gibson
2017-04-27 9:34 ` [Qemu-devel] [RFC PATCH 5/8] memory: rename *iommu_notifier* Peter Xu
2017-05-01 4:56 ` David Gibson
2017-04-27 9:34 ` [Qemu-devel] [RFC PATCH 6/8] memory: introduce AddressSpaceOps Peter Xu
2017-05-01 4:58 ` David Gibson
2017-05-08 5:48 ` Peter Xu
2017-05-08 6:07 ` David Gibson
2017-05-08 7:32 ` Peter Xu
2017-05-07 9:44 ` Liu, Yi L
2017-05-10 7:04 ` David Gibson
2017-05-11 5:04 ` Peter Xu
2017-05-15 5:32 ` David Gibson
2017-05-25 7:24 ` Peter Xu
2017-05-26 5:30 ` David Gibson
2017-06-08 8:24 ` Liu, Yi L
2017-04-27 9:34 ` [Qemu-devel] [RFC PATCH 7/8] intel_iommu: provide AddressSpaceOps.iommu_get() Peter Xu
2017-04-27 9:34 ` [Qemu-devel] [RFC PATCH 8/8] iommu: introduce hw/core/iommu Peter Xu
2017-04-28 10:01 ` Liu, Yi L
2017-04-28 10:34 ` Peter Xu
2017-06-07 7:51 ` Liu, Yi L
2017-06-07 8:28 ` Peter Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1493285660-4470-1-git-send-email-peterx@redhat.com \
--to=peterx@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=jasowang@redhat.com \
--cc=kevin.tian@intel.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=tianyu.lan@intel.com \
--cc=yi.l.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).