From patchwork Tue Sep 8 16:51:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 53280 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by patches.linaro.org (Postfix) with ESMTPS id 7203822B05 for ; Tue, 8 Sep 2015 16:57:07 +0000 (UTC) Received: by lanb10 with SMTP id b10sf40753711lan.3 for ; Tue, 08 Sep 2015 09:57:06 -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:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=joPzOJsrRPPol/fjM/N6MQFCZpr6vuUh60zC8pbjQmY=; b=Rcw8tri0A9qULXjxjGLmxejv8h4u5eZkDUqq2U2M5FGIqB7mJkp1vaam5WBb/Mp9xw GlUfuaZp1hgWvxxGPiD/5eAdrjFpzHjMpzuoGtD5isDkVaUc74EGfEbmQfWwiq0lVvVL wF0WPj1bNadENhaQ79QfdB6C21SX/h+u1K0QSrB2hGQdcHg0t3ZO2y43U0NJcWDXi2iH i1pzWgxJiulBp5j46KfaoJsNW9N9otM0SATRlNZgU0IchKnMLmFoR66ltsrFtamJYQ+i qtVl5D14P4NS8N/bkZA34HABa8ADQxnJigXsaMGkadErHjrmmNJve3CoIm7X6ufc8/oj g/Lg== X-Gm-Message-State: ALoCoQkkoPGZdjcgM9p81Nn0CtypoLcYFQx44LGkizu1FKqHw5rhnqKh/B5wO2FKgs/Clx4jdzOA X-Received: by 10.112.144.99 with SMTP id sl3mr6795980lbb.12.1441731426441; Tue, 08 Sep 2015 09:57:06 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.4.43 with SMTP id cb11ls378197lad.65.gmail; Tue, 08 Sep 2015 09:57:06 -0700 (PDT) X-Received: by 10.112.199.66 with SMTP id ji2mr23984622lbc.1.1441731425956; Tue, 08 Sep 2015 09:57:05 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id pp5si3764819lbb.166.2015.09.08.09.57.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Sep 2015 09:57:05 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by lamp12 with SMTP id p12so71548350lam.0 for ; Tue, 08 Sep 2015 09:57:05 -0700 (PDT) X-Received: by 10.112.166.106 with SMTP id zf10mr23750708lbb.36.1441731425862; Tue, 08 Sep 2015 09:57:05 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1096854lbq; Tue, 8 Sep 2015 09:57:04 -0700 (PDT) X-Received: by 10.140.25.146 with SMTP id 18mr35704438qgt.36.1441731424524; Tue, 08 Sep 2015 09:57:04 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id h13si4530908qhc.101.2015.09.08.09.57.03 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 08 Sep 2015 09:57:04 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:35821 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZMCd-0001Av-8J for patch@linaro.org; Tue, 08 Sep 2015 12:57:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZM7W-0002U4-31 for qemu-devel@nongnu.org; Tue, 08 Sep 2015 12:51:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZM7U-0007ub-UW for qemu-devel@nongnu.org; Tue, 08 Sep 2015 12:51:45 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:35049) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZM7U-0007b2-OV for qemu-devel@nongnu.org; Tue, 08 Sep 2015 12:51:44 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1ZZM7I-0001iE-KZ for qemu-devel@nongnu.org; Tue, 08 Sep 2015 17:51:32 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Tue, 8 Sep 2015 17:51:23 +0100 Message-Id: <1441731092-6513-12-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1441731092-6513-1-git-send-email-peter.maydell@linaro.org> References: <1441731092-6513-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 11/20] hw/arm/virt: Enable TZ extensions on the GIC if we are using them X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.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.54 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 Reviewed-by: Peter Maydell Reviewed-by: Edgar E. Iglesias Tested-by: Edgar E. Iglesias Message-id: 1441383782-24378-7-git-send-email-peter.maydell@linaro.org --- 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);