qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: dgibson@redhat.com, jasowang@redhat.com, mst@redhat.com,
	pbonzini@redhat.com, cornelia.huck@de.ibm.com, wexu@redhat.com,
	vkaplans@redhat.com, alex.williamson@redhat.com,
	peterx@redhat.com
Subject: [Qemu-devel] [PATCH v3 3/3] intel_iommu: allow invalidation typed notifiers
Date: Wed,  7 Sep 2016 13:32:24 +0800	[thread overview]
Message-ID: <1473226344-28520-4-git-send-email-peterx@redhat.com> (raw)
In-Reply-To: <1473226344-28520-1-git-send-email-peterx@redhat.com>

Intel vIOMMU is still lacking of a complete IOMMU notifier mechanism.
Before that is achieved, let's open a door for vhost DMAR support, which
only requires device-IOTLB based cache invalidations.

Meanwhile, converting hw_error() to error_report() and exit(), to make
the error messages clean and obvious (so no CPU registers will be
dumped).

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 hw/i386/intel_iommu.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index c6bd8f6..227c931 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -1978,10 +1978,14 @@ static void vtd_iommu_notifier_add(MemoryRegion *iommu, IOMMUNotifier *n)
 {
     VTDAddressSpace *vtd_as = container_of(iommu, VTDAddressSpace, iommu);
 
-    hw_error("Device at bus %s addr %02x.%d requires iommu notifier which "
-             "is currently not supported by intel-iommu emulation",
-             vtd_as->bus->qbus.name, PCI_SLOT(vtd_as->devfn),
-             PCI_FUNC(vtd_as->devfn));
+    if (n->notifier_caps & IOMMU_NOTIFIER_CHANGE) {
+        error_report("Device at bus %s addr %02x.%d requires iommu "
+                     "notifier which is currently not supported by "
+                     "intel-iommu emulation",
+                     vtd_as->bus->qbus.name, PCI_SLOT(vtd_as->devfn),
+                     PCI_FUNC(vtd_as->devfn));
+        exit(1);
+    }
 }
 
 static const VMStateDescription vtd_vmstate = {
-- 
2.7.4

      parent reply	other threads:[~2016-09-07  5:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-07  5:32 [Qemu-devel] [PATCH v3 0/3] Introduce IOMMUNotifier struct Peter Xu
2016-09-07  5:32 ` [Qemu-devel] [PATCH v3 1/3] memory: introduce IOMMUNotifier and its caps Peter Xu
2016-09-07  6:02   ` David Gibson
2016-09-07  7:09     ` Peter Xu
2016-09-07 10:20       ` David Gibson
2016-09-08 10:00         ` Peter Xu
2016-09-07  5:32 ` [Qemu-devel] [PATCH v3 2/3] memory: generalize iommu_ops.notify_started to notifier_add Peter Xu
2016-09-07  6:05   ` David Gibson
2016-09-07  7:23     ` Peter Xu
2016-09-07 10:23       ` David Gibson
2016-09-07 10:54     ` Paolo Bonzini
2016-09-08 10:22       ` Peter Xu
2016-09-12  1:17         ` David Gibson
2016-09-12  5:54           ` Peter Xu
2016-09-07  5:32 ` Peter Xu [this message]

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=1473226344-28520-4-git-send-email-peterx@redhat.com \
    --to=peterx@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=dgibson@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vkaplans@redhat.com \
    --cc=wexu@redhat.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).