From patchwork Tue Jun 30 13:07:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 50474 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4D553229DF for ; Tue, 30 Jun 2015 13:07:40 +0000 (UTC) Received: by lagx9 with SMTP id x9sf3438532lag.2 for ; Tue, 30 Jun 2015 06:07:39 -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=bA1NfCA24h1H+47AriOuiU1JSnE9jYU0I+PiZoMX6B8=; b=EJehIb+xdloP46wrbqGIW5VARreFKG2HpbeiXLeanUBjXF/EwqOtCSm/XJHEKekYoi IRjOTufyzwFL4aI/V4n9CHVdxOvUMqg/sx33N272CmVExfN77Vh4/2NUrnxuImNcQ9fl qKnVBaTwoeuO6toNvp56FYFVvux1nMn/NSE+1ngMwGR7yJ986Nr6obmVTU4ZDMm8IKtl qU+HtSuPvI/S3lrP0SZWCmEVIRRl4bsLfaHD/V8dkdJypnhBcW0+vfixfJqsZfXuCWs6 iiOFLaZ8P1Wi4OhGV9yRh3tdxK/ONMkRteQ4Fkv7fJplzd6jHK/b5UbWc65iO0YkvCSt khAw== X-Gm-Message-State: ALoCoQl7BXtLL5vB2FpnRtfl+qvZr2H/PHXu1574BPDgwkwDF78SDzxUTjb+dJdGi712HDbiG7j2 X-Received: by 10.194.81.136 with SMTP id a8mr14096623wjy.2.1435669659302; Tue, 30 Jun 2015 06:07:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.169 with SMTP id l9ls40833lah.52.gmail; Tue, 30 Jun 2015 06:07:39 -0700 (PDT) X-Received: by 10.152.37.67 with SMTP id w3mr19602258laj.123.1435669659011; Tue, 30 Jun 2015 06:07:39 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id kx6si38078064lac.108.2015.06.30.06.07.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jun 2015 06:07:38 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by lagx9 with SMTP id x9so12664224lag.1 for ; Tue, 30 Jun 2015 06:07:38 -0700 (PDT) X-Received: by 10.153.5.38 with SMTP id cj6mr19534689lad.36.1435669658513; Tue, 30 Jun 2015 06:07:38 -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.108.230 with SMTP id hn6csp2437219lbb; Tue, 30 Jun 2015 06:07:37 -0700 (PDT) X-Received: by 10.70.131.232 with SMTP id op8mr42685777pdb.156.1435669656799; Tue, 30 Jun 2015 06:07:36 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id uj9si69975000pbc.34.2015.06.30.06.07.34 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 30 Jun 2015 06:07:36 -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 1Z9vG6-0000nk-1z; Tue, 30 Jun 2015 14:07:30 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Peter Crosthwaite , "Edgar E. Iglesias" , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [PATCH 5/5] hw/arm/virt: Enable TZ extensions on the GIC if we are using them Date: Tue, 30 Jun 2015 14:07:29 +0100 Message-Id: <1435669649-3035-6-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1435669649-3035-1-git-send-email-peter.maydell@linaro.org> References: <1435669649-3035-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.52 as permitted sender) smtp.mail=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 --- 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 4846892..084a551 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -360,7 +360,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; @@ -379,6 +379,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); @@ -875,7 +878,7 @@ static void machvirt_init(MachineState *machine) create_flash(vbi); - create_gic(vbi, pic); + create_gic(vbi, pic, vms->secure); create_uart(vbi, pic);