[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v3 13/13] q35: add "int-remap" flag to enable intr

From: Peter Xu
Subject: [Qemu-devel] [PATCH v3 13/13] q35: add "int-remap" flag to enable intr
Date: Fri, 15 Apr 2016 11:31:39 +0800

One flag is added to specify whether to enable INTR for emulated
IOMMU. By default, interrupt remapping is not supportted. To enable it,
we should specify something like:

$ qemu-system-x86_64 -M q35,iommu=on,intr=on

To be more clear, the following command:

$ qemu-system-x86_64 -M q35,iommu=on

Will enable IOMMU only, without interrupt remapping support.

Currently, Intel IOMMU IR only support kernel-irqchip={off|split}. We
need to specify either of it in -M as well.

Signed-off-by: Peter Xu <address@hidden>
 hw/core/machine.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/hw/core/machine.c b/hw/core/machine.c
index 276ad61..b00f39f 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -300,6 +300,20 @@ static void machine_set_iommu(Object *obj, bool value, 
Error **errp)
     ms->iommu = value;
+static bool machine_get_intr(Object *obj, Error **errp)
+    MachineState *ms = MACHINE(obj);
+    return ms->iommu_intr;
+static void machine_set_intr(Object *obj, bool value, Error **errp)
+    MachineState *ms = MACHINE(obj);
+    ms->iommu_intr = value;
 static void machine_set_suppress_vmdesc(Object *obj, bool value, Error **errp)
     MachineState *ms = MACHINE(obj);
@@ -480,6 +494,12 @@ static void machine_initfn(Object *obj)
     object_property_set_description(obj, "iommu",
                                     "Set on/off to enable/disable Intel IOMMU 
+    object_property_add_bool(obj, "intr", machine_get_intr,
+                             machine_set_intr, NULL);
+    object_property_set_description(obj, "intr",
+                                    "Set on/off to enable/disable IOMMU"
+                                    " interrupt remapping",
+                                    NULL);
     object_property_add_bool(obj, "suppress-vmdesc",
                              machine_set_suppress_vmdesc, NULL);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]