qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Kiarie <davidkiarie4@gmail.com>
To: qemu-devel@nongnu.org
Cc: jan.kiszka@siemens.com, valentine.sinitsyn@gmail.com,
	mst@redhat.com, pbonzini@redhat.com, ehabkost@redhat.com,
	peter.maydell@linaro.org, David Kiarie <davidkiarie4@gmail.com>
Subject: [Qemu-devel] [V1 4/4] hw/iommu: share common between IOMMUs
Date: Wed, 10 Aug 2016 22:42:59 +0300	[thread overview]
Message-ID: <1470858179-27754-5-git-send-email-davidkiarie4@gmail.com> (raw)
In-Reply-To: <1470858179-27754-1-git-send-email-davidkiarie4@gmail.com>

Enabling interrupt remapping with kernel_irqchip=on should
result in error for both VT-d and AMD-Vi

Signed-off-by: David Kiarie <davidkiarie4@gmail.com>
---
 hw/i386/intel_iommu.c | 9 ---------
 hw/i386/x86-iommu.c   | 8 ++++++++
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 7c80907..857f9f1 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -30,7 +30,6 @@
 #include "hw/boards.h"
 #include "hw/i386/x86-iommu.h"
 #include "hw/pci-host/q35.h"
-#include "sysemu/kvm.h"
 
 #define DEBUG_INTEL_IOMMU
 #ifdef DEBUG_INTEL_IOMMU
@@ -2472,14 +2471,6 @@ static void vtd_realize(DeviceState *dev, Error **errp)
         Q35_PSEUDO_DEVFN_IOAPIC;
     /* Pseudo address space under root PCI bus. */
     pcms->ioapic_as = vtd_host_dma_iommu(bus, s, Q35_PSEUDO_DEVFN_IOAPIC);
-
-    /* Currently Intel IOMMU IR only support "kernel-irqchip={off|split}" */
-    if (x86_iommu->intr_supported && kvm_irqchip_in_kernel() &&
-        !kvm_irqchip_is_split()) {
-        error_report("Intel Interrupt Remapping cannot work with "
-                     "kernel-irqchip=on, please use 'split|off'.");
-        exit(1);
-    }
 }
 
 static void vtd_class_init(ObjectClass *klass, void *data)
diff --git a/hw/i386/x86-iommu.c b/hw/i386/x86-iommu.c
index 2278af7..66510f7 100644
--- a/hw/i386/x86-iommu.c
+++ b/hw/i386/x86-iommu.c
@@ -21,6 +21,7 @@
 #include "hw/sysbus.h"
 #include "hw/boards.h"
 #include "hw/i386/x86-iommu.h"
+#include "sysemu/kvm.h"
 #include "qemu/error-report.h"
 #include "trace.h"
 
@@ -84,6 +85,13 @@ static void x86_iommu_realize(DeviceState *dev, Error **errp)
     if (x86_class->realize) {
         x86_class->realize(dev, errp);
     }
+    /* Currently IOMMU IR only support "kernel-irqchip={off|split}" */
+    if (x86_iommu->intr_supported && kvm_irqchip_in_kernel() &&
+        !kvm_irqchip_is_split()) {
+        error_report("Interrupt Remapping cannot work with "
+                     "kernel-irqchip=on, please use 'split|off'.");
+        exit(1);
+    }
 
     x86_iommu_set_default(X86_IOMMU_DEVICE(dev));
 }
-- 
2.1.4

  parent reply	other threads:[~2016-08-10 19:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-10 19:42 [Qemu-devel] [V1 0/4] AMD-Vi Interrupt Remapping David Kiarie
2016-08-10 19:42 ` [Qemu-devel] [V1 1/4] hw/iommu: Prepare for AMD IOMMU interrupt remapping David Kiarie
2016-08-12 19:19   ` Valentine Sinitsyn
2016-08-10 19:42 ` [Qemu-devel] [V1 2/4] hw/iommu: " David Kiarie
2016-08-12 20:08   ` Valentine Sinitsyn
2016-08-12 20:30     ` David Kiarie
2016-08-10 19:42 ` [Qemu-devel] [V1 3/4] hw/acpi: report IOAPIC on IVRS David Kiarie
2016-08-12 20:14   ` Valentine Sinitsyn
2016-08-12 20:23     ` David Kiarie
2016-08-10 19:42 ` David Kiarie [this message]
2016-08-10 19:46 ` [Qemu-devel] [V1 0/4] AMD-Vi Interrupt Remapping David Kiarie
2016-08-11  6:39 ` Valentine Sinitsyn
2016-08-11  8:07   ` David Kiarie

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=1470858179-27754-5-git-send-email-davidkiarie4@gmail.com \
    --to=davidkiarie4@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=valentine.sinitsyn@gmail.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).