From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7KVU-0003Og-M5 for qemu-devel@nongnu.org; Mon, 30 May 2016 06:33:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b7KVN-0005aN-Uk for qemu-devel@nongnu.org; Mon, 30 May 2016 06:33:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34872) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b7KVN-0005aI-P3 for qemu-devel@nongnu.org; Mon, 30 May 2016 06:33:05 -0400 From: Peter Xu Date: Mon, 30 May 2016 18:31:29 +0800 Message-Id: <1464604298-16739-17-git-send-email-peterx@redhat.com> In-Reply-To: <1464604298-16739-1-git-send-email-peterx@redhat.com> References: <1464604298-16739-1-git-send-email-peterx@redhat.com> Subject: [Qemu-devel] [PATCH v8 16/25] q35: add "intremap" parameter to enable IR List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: imammedo@redhat.com, rth@twiddle.net, ehabkost@redhat.com, jasowang@redhat.com, marcel@redhat.com, mst@redhat.com, pbonzini@redhat.com, jan.kiszka@web.de, rkrcmar@redhat.com, alex.williamson@redhat.com, wexu@redhat.com, davidkiarie4@gmail.com, peterx@redhat.com One flag is added to specify whether to enable IR 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,intremap=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 --- hw/core/machine.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/hw/core/machine.c b/hw/core/machine.c index 98471a7..41d6a95 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -314,6 +314,20 @@ static void machine_set_iommu(Object *obj, bool value, Error **errp) ms->iommu = value; } +static bool machine_get_intremap(Object *obj, Error **errp) +{ + MachineState *ms = MACHINE(obj); + + return ms->iommu_intr; +} + +static void machine_set_intremap(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); @@ -501,6 +515,12 @@ static void machine_initfn(Object *obj) object_property_set_description(obj, "iommu", "Set on/off to enable/disable Intel IOMMU (VT-d)", NULL); + object_property_add_bool(obj, "intremap", machine_get_intremap, + machine_set_intremap, NULL); + object_property_set_description(obj, "intremap", + "Set on/off to enable/disable IOMMU" + " interrupt remapping", + NULL); object_property_add_bool(obj, "suppress-vmdesc", machine_get_suppress_vmdesc, machine_set_suppress_vmdesc, NULL); -- 2.4.11