From patchwork Thu Dec 11 23:29:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 42168 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 03F4826666 for ; Thu, 11 Dec 2014 23:35:28 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id q1sf4207372lam.2 for ; Thu, 11 Dec 2014 15:35:26 -0800 (PST) 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:cc: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=Oy5M2QwVNAk2YWA6Eg7SRbGUwe4oxKmWY1P/5wkWvIk=; b=VTJWp+zF7WRAj3sJFo7//CSHh2tr0ntZro8p+Hs09awOh6AhIY/tR54cskHWmNAsXz CAt1ZgcV+4C7ccROx2UPqJL23hcfPPhPa3NuDjpMDLPUZ8JZcdZqSMh5G6nS1Slzs8lD lr+4QvgVd5iXvmF4kIqDhJm2vYmyYgCKv909nspP8s/rZo6XzmkSpkivsrZPFK3aiM04 NmlE1N67GJMuKfUgRzW1nvZXCjYp1JDvWVmIbfl2jmUPE0lX3Mo1y0T/SxhGDbr3xC0d aqHLxO+iGbH20aB7e/QYkLDxEUvz3aRI1WB2gBkbfHRV8Aljh6Dz1DrZzDCnOH3wrN0d d3vQ== X-Gm-Message-State: ALoCoQkqMtzCxnBOqNGgUssbVezb0MdNB39nI9PxGRqrRa8mENQC2oam3Z8Eg5A5dOlk4W5zMz0d X-Received: by 10.194.133.39 with SMTP id oz7mr1856631wjb.3.1418340926256; Thu, 11 Dec 2014 15:35:26 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.72 with SMTP id b8ls77398laf.6.gmail; Thu, 11 Dec 2014 15:35:26 -0800 (PST) X-Received: by 10.112.35.234 with SMTP id l10mr12558589lbj.12.1418340926027; Thu, 11 Dec 2014 15:35:26 -0800 (PST) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id xo10si2734657lbb.74.2014.12.11.15.35.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Dec 2014 15:35:25 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by mail-la0-f47.google.com with SMTP id hz20so5277746lab.34 for ; Thu, 11 Dec 2014 15:35:25 -0800 (PST) X-Received: by 10.112.170.36 with SMTP id aj4mr12395962lbc.3.1418340925720; Thu, 11 Dec 2014 15:35:25 -0800 (PST) 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.142.69 with SMTP id ru5csp686934lbb; Thu, 11 Dec 2014 15:35:24 -0800 (PST) X-Received: by 10.140.85.104 with SMTP id m95mr23539360qgd.93.1418340924293; Thu, 11 Dec 2014 15:35:24 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id w81si3182560qge.81.2014.12.11.15.35.23 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 11 Dec 2014 15:35:24 -0800 (PST) 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]:54675 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzDGV-0004Im-DC for patch@linaro.org; Thu, 11 Dec 2014 18:35:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzDBO-00047h-GW for qemu-devel@nongnu.org; Thu, 11 Dec 2014 18:30:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XzDBI-00013N-IO for qemu-devel@nongnu.org; Thu, 11 Dec 2014 18:30:06 -0500 Received: from mail-pd0-f179.google.com ([209.85.192.179]:42650) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XzDBI-00012k-D8 for qemu-devel@nongnu.org; Thu, 11 Dec 2014 18:30:00 -0500 Received: by mail-pd0-f179.google.com with SMTP id fp1so5885359pdb.24 for ; Thu, 11 Dec 2014 15:29:59 -0800 (PST) X-Received: by 10.68.57.167 with SMTP id j7mr21671768pbq.160.1418340599866; Thu, 11 Dec 2014 15:29:59 -0800 (PST) Received: from gbellows-linaro.qualcomm.com (rrcs-67-52-129-61.west.biz.rr.com. [67.52.129.61]) by mx.google.com with ESMTPSA id ip1sm2362908pbc.0.2014.12.11.15.29.58 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Dec 2014 15:29:59 -0800 (PST) From: Greg Bellows To: qemu-devel@nongnu.org, serge.fdrv@gmail.com, edgar.iglesias@gmail.com, aggelerf@ethz.ch, peter.maydell@linaro.org Date: Thu, 11 Dec 2014 17:29:26 -0600 Message-Id: <1418340569-30519-13-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1418340569-30519-1-git-send-email-greg.bellows@linaro.org> References: <1418340569-30519-1-git-send-email-greg.bellows@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.192.179 Cc: Greg Bellows Subject: [Qemu-devel] [PATCH v2 12/15] target-arm: Set CPU has_el3 prop during virt init 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: greg.bellows@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.47 as permitted sender) smtp.mail=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 Adds setting of the CPU has_el3 property based on the virt machine secure state property during initialization. This enables/disables EL3 state during start-up. Changes include adding an additional secure state boolean during virt CPU initialization. Also disables the ARM secure boot by default. Signed-off-by: Greg Bellows --- v1 -> v2 - Changes CPU property name from "secure" to "has_el3" - Change conditional to handle machine state default of secure. The check now checks if the machine secure property has been disabled which causes the CPU EL3 feature to be disabled. - Add setting of arm_boot_info.secure_boot to false --- hw/arm/virt.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 3eacc43..19d6174 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -547,6 +547,7 @@ static void *machvirt_dtb(const struct arm_boot_info *binfo, int *fdt_size) static void machvirt_init(MachineState *machine) { + VirtMachineState *vms = VIRT_MACHINE(machine); qemu_irq pic[NUM_IRQS]; MemoryRegion *sysmem = get_system_memory(); int n; @@ -584,6 +585,16 @@ static void machvirt_init(MachineState *machine) } cpuobj = object_new(object_class_get_name(oc)); + if (!vms->secure) { + Error *err = NULL; + object_property_set_bool(cpuobj, false, "has_el3", &err); + if (err) { + error_report("'secure' machine property not supported " + "with %s cpu", cpu_model); + exit(1); + } + } + object_property_set_int(cpuobj, QEMU_PSCI_CONDUIT_HVC, "psci-conduit", NULL); @@ -630,6 +641,8 @@ static void machvirt_init(MachineState *machine) vbi->bootinfo.board_id = -1; vbi->bootinfo.loader_start = vbi->memmap[VIRT_MEM].base; vbi->bootinfo.get_dtb = machvirt_dtb; + /* Indicate that when booting Linux we should be in non-secure state */ + vbi->bootinfo.secure_boot = false; arm_load_kernel(ARM_CPU(first_cpu), &vbi->bootinfo); }