From patchwork Mon Dec 15 18:51:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 42282 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 2FFA62456A for ; Mon, 15 Dec 2014 18:57:46 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id gq15sf7696366lab.3 for ; Mon, 15 Dec 2014 10:57:45 -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=qZpuKnwJZq6zyb3ERmyaOiHaYXbVLS++3sI5yqBGCNg=; b=aDGiDjO1pnJ4jqeGdqFw5xL8PoafgX76Svqz4JvLuPhTm3XGCfLezgZcMh+Kgjdd0K X0L/0kbNwl0SC5M+J5/v+qkLqPY30BQv3x/e67y9FYaB/qmBxga+UGRAy1kWfliYuvy6 GmNkB0fHMoi6m7Rfi/tGNe007o9nnRRHMohSPHi3+CnV57ampvFfNSKfpmitPy+OfVsC mFkxifqK2X92kLqlvEEDKrQV/01iBMGj6fajHga2lgY8pHqIhO4MgSPoISc6SKbTstTA BJdL57RpaNf34yz1H72YamvD4Gyfbm0Y+nkp+o7pB2j1hFQkybyC/p9Un79e7we54GD2 PW/A== X-Gm-Message-State: ALoCoQkFkhkAFdKxGNtTGEbDuYX9AIvQ7pXgUCDgIc4G0a5mfArkOaTycDfjZOwi9DoNTW2VcOSH X-Received: by 10.180.189.116 with SMTP id gh20mr3067963wic.2.1418669865172; Mon, 15 Dec 2014 10:57:45 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.166 with SMTP id u6ls799292lag.41.gmail; Mon, 15 Dec 2014 10:57:44 -0800 (PST) X-Received: by 10.112.141.42 with SMTP id rl10mr31666477lbb.98.1418669864856; Mon, 15 Dec 2014 10:57:44 -0800 (PST) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id l5si11297331lbs.94.2014.12.15.10.57.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Dec 2014 10:57:44 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id gq15so9903169lab.4 for ; Mon, 15 Dec 2014 10:57:44 -0800 (PST) X-Received: by 10.152.2.74 with SMTP id 10mr31157544las.38.1418669864760; Mon, 15 Dec 2014 10:57:44 -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 ru5csp809892lbb; Mon, 15 Dec 2014 10:57:44 -0800 (PST) X-Received: by 10.224.80.195 with SMTP id u3mr50981584qak.60.1418669863495; Mon, 15 Dec 2014 10:57:43 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id x4si11627694qas.35.2014.12.15.10.57.42 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 15 Dec 2014 10:57:43 -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]:41493 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0apy-0001Np-K1 for patch@linaro.org; Mon, 15 Dec 2014 13:57:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38357) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0akN-0000oo-MT for qemu-devel@nongnu.org; Mon, 15 Dec 2014 13:52:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0akH-0005xa-Qd for qemu-devel@nongnu.org; Mon, 15 Dec 2014 13:51:55 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:34707) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0akH-0005xP-Ks for qemu-devel@nongnu.org; Mon, 15 Dec 2014 13:51:49 -0500 Received: by mail-pa0-f50.google.com with SMTP id bj1so12311007pad.23 for ; Mon, 15 Dec 2014 10:51:49 -0800 (PST) X-Received: by 10.66.197.135 with SMTP id iu7mr49670646pac.155.1418669509071; Mon, 15 Dec 2014 10:51:49 -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 bq7sm9972513pdb.50.2014.12.15.10.51.47 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 15 Dec 2014 10:51:48 -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 12:51:16 -0600 Message-Id: <1418669479-23908-13-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1418669479-23908-1-git-send-email-greg.bellows@linaro.org> References: <1418669479-23908-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.220.50 Cc: Greg Bellows Subject: [Qemu-devel] [PATCH v3 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.45 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 v2 -> v3 - Silently ignore error if "has_el3" does not exist - Remove board initialization of secure_boot as it is implied. - Revise secure machine property description --- hw/arm/virt.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 3eacc43..3a49ad0 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -96,6 +96,9 @@ typedef struct { bool secure; } VirtMachineState; +#define SECURE_PROP_DESC \ + "Set on/off to enable/disable the ARM Security Extensions (TrustZone)" + #define TYPE_VIRT_MACHINE "virt" #define VIRT_MACHINE(obj) \ OBJECT_CHECK(VirtMachineState, (obj), TYPE_VIRT_MACHINE) @@ -547,6 +550,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 +588,10 @@ static void machvirt_init(MachineState *machine) } cpuobj = object_new(object_class_get_name(oc)); + if (!vms->secure) { + object_property_set_bool(cpuobj, false, "has_el3", NULL); + } + object_property_set_int(cpuobj, QEMU_PSCI_CONDUIT_HVC, "psci-conduit", NULL); @@ -655,9 +663,7 @@ static void virt_instance_init(Object *obj) vms->secure = true; object_property_add_bool(obj, "secure", virt_get_secure, virt_set_secure, NULL); - object_property_set_description(obj, "secure", - "Set on/off to enable/disable secure state", - NULL); + object_property_set_description(obj, "secure", SECURE_PROP_DESC, NULL); } static void virt_class_init(ObjectClass *oc, void *data)