From patchwork Wed Dec 3 20:06:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 41867 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 481C825E88 for ; Wed, 3 Dec 2014 20:07:59 +0000 (UTC) Received: by mail-la0-f69.google.com with SMTP id ge10sf6532259lab.4 for ; Wed, 03 Dec 2014 12:07:58 -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=VapvEeghdr9sVrFD9XUZfrFOtBd1RyPdJhvSIAlUwWw=; b=YMISGSFzSa8m9JPiSRlhr63b1LiNgQDzmG8y50yFhW3SaWIkZAPqk6nCRqLDc6SKXe fvt6eDkUpc/6Pan6XADTb5MYDp9aPZpRJjCnFbKD7xbhEmjVw3nV9sovXEYeQNQN/KrM MqOKi8D7ORScp/Ty8Iq3KDG3POkEOp6+tITs4L/mWDlJLtQrHzEmmrE6W/uywaYe0dO0 nwc1BZwKuyEIBydzeuJJx3N7qKoN10QGoBWudMAicWRpJ3POiYxsvse8W9jvANTWSK4k 0K1iQlSv5enV8KF7GP4Qu+IFB03Jmjb1ATyoxm5PVTXgVy9f0e1IfB1GsXesbPwy59kn VfgA== X-Gm-Message-State: ALoCoQmM6/imTx2LrujKgBL7j4wHNbGJzWlTsD+tIURAQk4rXajtHLZzxw/buXGm9gjlyA4Ye+jK X-Received: by 10.180.102.228 with SMTP id fr4mr16735702wib.1.1417637278147; Wed, 03 Dec 2014 12:07:58 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.116.14 with SMTP id js14ls136528lab.69.gmail; Wed, 03 Dec 2014 12:07:58 -0800 (PST) X-Received: by 10.112.45.228 with SMTP id q4mr5961425lbm.35.1417637277994; Wed, 03 Dec 2014 12:07:57 -0800 (PST) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPS id rd1si23938706lac.70.2014.12.03.12.07.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 12:07:57 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.46 as permitted sender) client-ip=209.85.215.46; Received: by mail-la0-f46.google.com with SMTP id q1so8149911lam.5 for ; Wed, 03 Dec 2014 12:07:57 -0800 (PST) X-Received: by 10.112.189.10 with SMTP id ge10mr5795689lbc.23.1417637277881; Wed, 03 Dec 2014 12:07:57 -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.184.201 with SMTP id ew9csp730719lbc; Wed, 3 Dec 2014 12:07:57 -0800 (PST) X-Received: by 10.194.23.10 with SMTP id i10mr9826103wjf.11.1417637276071; Wed, 03 Dec 2014 12:07:56 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id t7si12902410wiz.25.2014.12.03.12.07.55 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 03 Dec 2014 12:07:56 -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]:43146 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwGDK-0008AD-QU for patch@linaro.org; Wed, 03 Dec 2014 15:07:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwGC2-0006qr-AP for qemu-devel@nongnu.org; Wed, 03 Dec 2014 15:06:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XwGBw-0003Yc-21 for qemu-devel@nongnu.org; Wed, 03 Dec 2014 15:06:34 -0500 Received: from mail-oi0-f51.google.com ([209.85.218.51]:59477) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwGBv-0003YW-U0 for qemu-devel@nongnu.org; Wed, 03 Dec 2014 15:06:27 -0500 Received: by mail-oi0-f51.google.com with SMTP id e131so11361244oig.10 for ; Wed, 03 Dec 2014 12:06:27 -0800 (PST) X-Received: by 10.202.173.198 with SMTP id w189mr3959793oie.27.1417637187587; Wed, 03 Dec 2014 12:06:27 -0800 (PST) Received: from gbellows-linaro.bellowshome.net (99-179-1-128.lightspeed.austtx.sbcglobal.net. [99.179.1.128]) by mx.google.com with ESMTPSA id mq4sm11787321obb.22.2014.12.03.12.06.26 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 12:06:26 -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: Wed, 3 Dec 2014 14:06:05 -0600 Message-Id: <1417637167-20640-12-git-send-email-greg.bellows@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1417637167-20640-1-git-send-email-greg.bellows@linaro.org> References: <1417637167-20640-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.218.51 Cc: Greg Bellows Subject: [Qemu-devel] [PATCH 11/13] target-arm: Set CPU secure 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.215.46 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 secure state property based on the vexpress machine secure state property during initialization. This enablesi/disables secure state during start-up. Changes include adding an additional secure state boolean during vexpress CPU initialization. Signed-off-by: Greg Bellows --- hw/arm/vexpress.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index 4a345d8..392293f 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,15 @@ 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, true, "secure", &err); + if (err) { + error_report("'secure' machine property not supported " + "with %s cpu", cpu_model); + exit(1); + } + } + if (object_property_find(cpuobj, "reset-cbar", NULL)) { object_property_set_int(cpuobj, periphbase, "reset-cbar", &error_abort); @@ -288,7 +297,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 +383,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: */