From patchwork Mon Dec 15 23:09:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 42306 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 0D42126C6C for ; Mon, 15 Dec 2014 23:18:28 +0000 (UTC) Received: by mail-la0-f71.google.com with SMTP id q1sf7946013lam.2 for ; Mon, 15 Dec 2014 15:18:27 -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=675LmJGBjlM9rbJGyXAExHrQgbPmssJybEnZ4GUee0k=; b=F9krBLB/PHOutXLvJ7DPsT7+tYsMXDHX5uDwOHxpBwohCSb7sshkZY2ULfcs3bJACV 9ccdoSTha5JGgU/qXXz7CD+Tq29EN30Eio7CVlEIJQ/gvkFw7G+CWx3Z216SQBp9Gtsr LWsEuUwgeSVvD5pjrumreGaIqBfZhxmUuLOxUIQSwunWo31ZTMFhCkSGRUtTOjseZbRZ +SLpRAGZT/8LaEqcEGHCwCwBm7SlzHDDihZHo9Nv1Ufa0DhhG8af5wDMLbt+ANtr84Uo 4VV3Z/wRSfQrreKo7PPgzuvtO/LOV7i6TYjerPmu7HoCXoaVNT3cijiIqSYZl27YPKKb mjVg== X-Gm-Message-State: ALoCoQm+XUJ8Yi51zunnfgHCQGIQKlKy8c5tKO1ZTFksEmbDAdQxJXVidGVFiYElQik/vuqDzr98 X-Received: by 10.180.24.35 with SMTP id r3mr3204755wif.0.1418685507027; Mon, 15 Dec 2014 15:18:27 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.37 with SMTP id g5ls782443lah.102.gmail; Mon, 15 Dec 2014 15:18:26 -0800 (PST) X-Received: by 10.112.135.229 with SMTP id pv5mr32757660lbb.52.1418685506625; Mon, 15 Dec 2014 15:18:26 -0800 (PST) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id e3si11811080lah.89.2014.12.15.15.18.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Dec 2014 15:18:26 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by mail-lb0-f173.google.com with SMTP id z12so9845872lbi.4 for ; Mon, 15 Dec 2014 15:18:26 -0800 (PST) X-Received: by 10.112.219.37 with SMTP id pl5mr29971203lbc.25.1418685506531; Mon, 15 Dec 2014 15:18:26 -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 ru5csp867561lbb; Mon, 15 Dec 2014 15:18:25 -0800 (PST) X-Received: by 10.140.49.107 with SMTP id p98mr56928265qga.20.1418685504810; Mon, 15 Dec 2014 15:18:24 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id k1si8971329qce.32.2014.12.15.15.18.24 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 15 Dec 2014 15:18: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]:42382 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0euF-00088d-KO for patch@linaro.org; Mon, 15 Dec 2014 18:18:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36060) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0ema-0003oV-93 for qemu-devel@nongnu.org; Mon, 15 Dec 2014 18:10:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0emS-0000hU-SL for qemu-devel@nongnu.org; Mon, 15 Dec 2014 18:10:27 -0500 Received: from mail-pd0-f173.google.com ([209.85.192.173]:62566) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0emS-0000hE-Na for qemu-devel@nongnu.org; Mon, 15 Dec 2014 18:10:20 -0500 Received: by mail-pd0-f173.google.com with SMTP id ft15so12591653pdb.4 for ; Mon, 15 Dec 2014 15:10:20 -0800 (PST) X-Received: by 10.70.92.166 with SMTP id cn6mr2026107pdb.164.1418685020332; Mon, 15 Dec 2014 15:10:20 -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 uq15sm10402467pab.8.2014.12.15.15.10.18 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Dec 2014 15:10:19 -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: Mon, 15 Dec 2014 17:09:48 -0600 Message-Id: <1418684992-8996-12-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1418684992-8996-1-git-send-email-greg.bellows@linaro.org> References: <1418684992-8996-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.173 Cc: Greg Bellows Subject: [Qemu-devel] [PATCH v4 11/15] target-arm: Enable CPU has_el3 prop during VE 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.217.173 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 vexpress machine secure state property during initialization. This enables/disables EL3 state during start-up. Changes include adding an additional secure state boolean during vexpress CPU initialization. Also enables 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 feautre to be disabled. - Add setting of arm_boot_info.secure_boot to true v2 -> v3 - Silently ignore error if "has_el3" does not exist. - Revise secure machine property description v3 -> v4 - Move machine secure property description change to correct patch. --- hw/arm/vexpress.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index c63c422..84415c8 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -196,7 +196,7 @@ struct VEDBoardInfo { }; static void init_cpus(const char *cpu_model, const char *privdev, - hwaddr periphbase, qemu_irq *pic) + hwaddr periphbase, qemu_irq *pic, bool secure) { ObjectClass *cpu_oc = cpu_class_by_name(TYPE_ARM_CPU, cpu_model); DeviceState *dev; @@ -213,6 +213,10 @@ static void init_cpus(const char *cpu_model, const char *privdev, Object *cpuobj = object_new(object_class_get_name(cpu_oc)); Error *err = NULL; + if (!secure) { + object_property_set_bool(cpuobj, false, "has_el3", NULL); + } + if (object_property_find(cpuobj, "reset-cbar", NULL)) { object_property_set_int(cpuobj, periphbase, "reset-cbar", &error_abort); @@ -288,7 +292,7 @@ static void a9_daughterboard_init(const VexpressMachineState *vms, memory_region_add_subregion(sysmem, 0x60000000, ram); /* 0x1e000000 A9MPCore (SCU) private memory region */ - init_cpus(cpu_model, "a9mpcore_priv", 0x1e000000, pic); + init_cpus(cpu_model, "a9mpcore_priv", 0x1e000000, pic, vms->secure); /* Daughterboard peripherals : 0x10020000 .. 0x20000000 */ @@ -374,7 +378,7 @@ static void a15_daughterboard_init(const VexpressMachineState *vms, memory_region_add_subregion(sysmem, 0x80000000, ram); /* 0x2c000000 A15MPCore private memory region (GIC) */ - init_cpus(cpu_model, "a15mpcore_priv", 0x2c000000, pic); + init_cpus(cpu_model, "a15mpcore_priv", 0x2c000000, pic, vms->secure); /* A15 daughterboard peripherals: */ @@ -699,6 +703,8 @@ static void vexpress_common_init(MachineState *machine) daughterboard->bootinfo.smp_bootreg_addr = map[VE_SYSREGS] + 0x30; daughterboard->bootinfo.gic_cpu_if_addr = daughterboard->gic_cpu_if_addr; daughterboard->bootinfo.modify_dtb = vexpress_modify_dtb; + /* Indicate that when booting Linux we should be in secure state */ + daughterboard->bootinfo.secure_boot = true; arm_load_kernel(ARM_CPU(first_cpu), &daughterboard->bootinfo); }