From patchwork Fri Sep 4 16:23:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 53132 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by patches.linaro.org (Postfix) with ESMTPS id 22FA82159E for ; Fri, 4 Sep 2015 16:23:15 +0000 (UTC) Received: by wisv5 with SMTP id v5sf8086275wis.0 for ; Fri, 04 Sep 2015 09:23:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=WadxPhmMaJcPHFDVi3WqJgCWjZc9HvZuKKZMCoZWkJQ=; b=mDXNRYWZf8CvtJ8o6rPQj7P0Ol0TT1MXaMakJ5JadSkymoM3qEvlN12qtw0ZrzMTwf liS//nAp1IH9v4QnuN6jNH/F0RGLiFyUISOs9tuMRmX1khL5mu+r59sK5C3JTVEAMTrD YK3aLG6Z602dqAlZ+Vdq599qYb6SeT3x9ckB2BOkRlSryaGZvZvkXYcxtBpMg9Q39xLI itzNeg0loA+gixN1yiLG3ZWBDrmOuX9a0c+LGiJGfLiP/EGTTR9k0BgM/hIBwK699bbk h0THcdLHCrmuedn0TP/XuyNZw4UcTX2E5R5vofz/p0weaM0kXPbvM+/2/vOcn+rzxyho w0pw== X-Gm-Message-State: ALoCoQku8BrR/RmEBTYe4qYdabsGHcuXl8b4Cqod0vRLS0oOoZ7gUaHJ3ocq+LuWpT3Kzp5gTzFu X-Received: by 10.112.89.228 with SMTP id br4mr1236532lbb.3.1441383794432; Fri, 04 Sep 2015 09:23:14 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.168 with SMTP id o8ls294659lae.47.gmail; Fri, 04 Sep 2015 09:23:14 -0700 (PDT) X-Received: by 10.152.6.41 with SMTP id x9mr4034807lax.120.1441383794225; Fri, 04 Sep 2015 09:23:14 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id pp10si2695250lbc.132.2015.09.04.09.23.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Sep 2015 09:23:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by lamp12 with SMTP id p12so16302218lam.0 for ; Fri, 04 Sep 2015 09:23:14 -0700 (PDT) X-Received: by 10.112.235.130 with SMTP id um2mr4455798lbc.72.1441383794079; Fri, 04 Sep 2015 09:23:14 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.164.42 with SMTP id yn10csp14682lbb; Fri, 4 Sep 2015 09:23:13 -0700 (PDT) X-Received: by 10.66.163.161 with SMTP id yj1mr9978559pab.34.1441383788205; Fri, 04 Sep 2015 09:23:08 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id vm1si5067847pbc.123.2015.09.04.09.23.06 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 04 Sep 2015 09:23:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1ZXtlW-0006M2-Ot; Fri, 04 Sep 2015 17:23:02 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, "Edgar E. Iglesias" Subject: [PATCH v3 6/6] hw/arm/virt: Enable TZ extensions on the GIC if we are using them Date: Fri, 4 Sep 2015 17:23:02 +0100 Message-Id: <1441383782-24378-7-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1441383782-24378-1-git-send-email-peter.maydell@linaro.org> References: <1441383782-24378-1-git-send-email-peter.maydell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , If we're creating a board with support for TrustZone, then enable it on the GIC model as well as on the CPUs. Signed-off-by: Peter Maydell Reviewed-by: Peter Crosthwaite --- hw/arm/virt.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index a067748..e9324f5 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -396,7 +396,7 @@ static void create_v2m(VirtBoardInfo *vbi, qemu_irq *pic) fdt_add_v2m_gic_node(vbi); } -static void create_gic(VirtBoardInfo *vbi, qemu_irq *pic) +static void create_gic(VirtBoardInfo *vbi, qemu_irq *pic, bool secure) { /* We create a standalone GIC v2 */ DeviceState *gicdev; @@ -413,6 +413,9 @@ static void create_gic(VirtBoardInfo *vbi, qemu_irq *pic) * interrupts; there are always 32 of the former (mandated by GIC spec). */ qdev_prop_set_uint32(gicdev, "num-irq", NUM_IRQS + 32); + if (!kvm_irqchip_in_kernel()) { + qdev_prop_set_bit(gicdev, "has-security-extensions", secure); + } qdev_init_nofail(gicdev); gicbusdev = SYS_BUS_DEVICE(gicdev); sysbus_mmio_map(gicbusdev, 0, vbi->memmap[VIRT_GIC_DIST].base); @@ -967,7 +970,7 @@ static void machvirt_init(MachineState *machine) create_flash(vbi); - create_gic(vbi, pic); + create_gic(vbi, pic, vms->secure); create_uart(vbi, pic);