From patchwork Fri Feb 17 13:53:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 9579845 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B4DDA600F6 for ; Fri, 17 Feb 2017 13:54:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DA3E28681 for ; Fri, 17 Feb 2017 13:54:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 920CB286DA; Fri, 17 Feb 2017 13:54:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 17E7528681 for ; Fri, 17 Feb 2017 13:54:05 +0000 (UTC) Received: from localhost ([::1]:53868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ceiz6-00023c-KL for patchwork-qemu-devel@patchwork.kernel.org; Fri, 17 Feb 2017 08:54:04 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ceiyl-0001w9-P8 for qemu-devel@nongnu.org; Fri, 17 Feb 2017 08:53:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ceiyk-0003yw-NP for qemu-devel@nongnu.org; Fri, 17 Feb 2017 08:53:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59562) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ceiye-0003uM-9D; Fri, 17 Feb 2017 08:53:36 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2734361B96; Fri, 17 Feb 2017 13:53:36 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-36.ams2.redhat.com [10.36.116.36]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1HDrXt6013386; Fri, 17 Feb 2017 08:53:34 -0500 From: Eric Auger To: eric.auger.pro@gmail.com, eric.auger@redhat.com, peter.maydell@linaro.org, qemu-arm@nongnu.org, qemu-devel@nongnu.org Date: Fri, 17 Feb 2017 14:53:19 +0100 Message-Id: <1487339599-20910-1-git-send-email-eric.auger@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 17 Feb 2017 13:53:36 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] hw/arm/virt: Add a user option to disallow ITS instantiation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: drjones@redhat.com, vijay.kilari@gmail.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP In 2.9 ITS will block save/restore and migration use cases. As such let's introduce a user option that disallows its instantiation along with the GICv3. With no-its option turned true, migration will be possible, obviously at the expense of MSI support (with GICv3). Signed-off-by: Eric Auger --- With this patch the option also is added in virt 2.8. I don't know if it is acceptable. --- hw/arm/virt.c | 28 +++++++++++++++++++++++++++- include/hw/arm/virt.h | 1 + 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index f3440f2..702a392 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -605,7 +605,7 @@ static void create_gic(VirtMachineState *vms, qemu_irq *pic) fdt_add_gic_node(vms); - if (type == 3 && !vmc->no_its) { + if (type == 3 && !vmc->no_its && !vms->no_its) { create_its(vms, gicdev); } else if (type == 2) { create_v2m(vms, pic); @@ -1480,6 +1480,21 @@ static void virt_set_highmem(Object *obj, bool value, Error **errp) vms->highmem = value; } +static bool virt_get_no_its(Object *obj, Error **errp) +{ + VirtMachineState *vms = VIRT_MACHINE(obj); + + return vms->no_its; +} + +static void virt_set_no_its(Object *obj, bool value, Error **errp) +{ + VirtMachineState *vms = VIRT_MACHINE(obj); + + vms->no_its = value; +} + + static char *virt_get_gic_version(Object *obj, Error **errp) { VirtMachineState *vms = VIRT_MACHINE(obj); @@ -1540,6 +1555,7 @@ type_init(machvirt_machine_init); static void virt_2_9_instance_init(Object *obj) { VirtMachineState *vms = VIRT_MACHINE(obj); + VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms); /* EL3 is disabled by default on virt: this makes us consistent * between KVM and TCG for this board, and it also allows us to @@ -1579,6 +1595,16 @@ static void virt_2_9_instance_init(Object *obj) "Set GIC version. " "Valid values are 2, 3 and host", NULL); + /* Default allows ITS instantiation */ + if (!vmc->no_its) { + object_property_add_bool(obj, "no-its", virt_get_no_its, + virt_set_no_its, NULL); + vms->no_its = false; + object_property_set_description(obj, "no-its", + "Disallow the ITS instantiation" + NULL); + } + vms->memmap = a15memmap; vms->irqmap = a15irqmap; } diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index 58ce74e..5e73be9 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -93,6 +93,7 @@ typedef struct { FWCfgState *fw_cfg; bool secure; bool highmem; + bool no_its; bool virt; int32_t gic_version; struct arm_boot_info bootinfo;