From patchwork Wed Dec 3 20:06:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Bellows X-Patchwork-Id: 41876 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AA46325E88 for ; Wed, 3 Dec 2014 20:16:11 +0000 (UTC) Received: by mail-wg0-f69.google.com with SMTP id k14sf9978515wgh.8 for ; Wed, 03 Dec 2014 12:16:11 -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=jeRlLPf0lrU1xRV5FHrIPa3an2Ja6BS845vhSbHqhoA=; b=jluqd0N83Y99Ton4XdA1DFZ6ksgJNFMTJVLzE6hDsrW+jlsUvVnJ1linHmT0JwO7oP QrLt9qSl/ioYxLGsEJnLWBW7BJruSu1g1IDwhor75m0mhxQ1fdWm9LpUSczj+FSHIOdt rnialDuge2vZx/RniZUnpQnV/znlVf6oSiaz8ZCN3kx4XIaWSSVL+NvYiTQM2IaUuLfo UsH86jdbZGK7obDhsCE3LDb6Zyh2BcyqfcTOMQKACDRaspDenPv2/FdF1KkxN+qnp6Tr A9qPVNPZHcE0FObAwrCV0JSFaQR7Z30fNu0gIC6UoQImcW6pqLDDCK9qY3QUGxSyUVxT dYeA== X-Gm-Message-State: ALoCoQmVYO3k6naXGjrcoQXOVydv2Ml4Im6SC/A5XYWJtVlvStK+Yqt6A81pGGpYY1I8sg7mS5YS X-Received: by 10.112.151.38 with SMTP id un6mr1467690lbb.0.1417637770946; Wed, 03 Dec 2014 12:16:10 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.39 with SMTP id j7ls214018laf.92.gmail; Wed, 03 Dec 2014 12:16:10 -0800 (PST) X-Received: by 10.152.28.131 with SMTP id b3mr6239689lah.12.1417637770800; Wed, 03 Dec 2014 12:16:10 -0800 (PST) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id x7si22268946lae.100.2014.12.03.12.16.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 12:16:10 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by mail-lb0-f176.google.com with SMTP id p9so13176474lbv.35 for ; Wed, 03 Dec 2014 12:16:10 -0800 (PST) X-Received: by 10.152.43.12 with SMTP id s12mr5780162lal.67.1417637770682; Wed, 03 Dec 2014 12:16:10 -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 ew9csp732094lbc; Wed, 3 Dec 2014 12:16:09 -0800 (PST) X-Received: by 10.180.77.79 with SMTP id q15mr102842058wiw.8.1417637769696; Wed, 03 Dec 2014 12:16:09 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id e9si41472620wjq.111.2014.12.03.12.16.09 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 03 Dec 2014 12:16:09 -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]:43231 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwGLI-0003Al-FX for patch@linaro.org; Wed, 03 Dec 2014 15:16:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwGC3-0006sk-9E for qemu-devel@nongnu.org; Wed, 03 Dec 2014 15:06:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XwGBx-0003ZM-3y for qemu-devel@nongnu.org; Wed, 03 Dec 2014 15:06:35 -0500 Received: from mail-ob0-f177.google.com ([209.85.214.177]:34682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwGBw-0003Z7-W6 for qemu-devel@nongnu.org; Wed, 03 Dec 2014 15:06:29 -0500 Received: by mail-ob0-f177.google.com with SMTP id va2so1630767obc.22 for ; Wed, 03 Dec 2014 12:06:28 -0800 (PST) X-Received: by 10.182.97.66 with SMTP id dy2mr4330316obb.30.1417637188710; Wed, 03 Dec 2014 12:06:28 -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.27 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Dec 2014 12:06:28 -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:06 -0600 Message-Id: <1417637167-20640-13-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.214.177 Cc: Greg Bellows Subject: [Qemu-devel] [PATCH 12/13] target-arm: Set CPU secure 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.217.176 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 Add setting of the CPU secure property based on the virt machine secure property during initialization. This enables/disables secure state during start-up. Signed-off-by: Greg Bellows --- hw/arm/virt.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index ba034e4..2f075e2 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, true, "secure", &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);