From patchwork Thu May 19 22:54:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 9128397 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 131EE60467 for ; Thu, 19 May 2016 22:55:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04D391FEDE for ; Thu, 19 May 2016 22:55:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB69620265; Thu, 19 May 2016 22:55:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5781D1FEDE for ; Thu, 19 May 2016 22:55:08 +0000 (UTC) Received: from localhost ([::1]:52418 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3WqR-0008Tj-Du for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 May 2016 18:55:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45863) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3Wpr-0008N9-0E for qemu-devel@nongnu.org; Thu, 19 May 2016 18:54:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3Wpk-0007Fc-0c for qemu-devel@nongnu.org; Thu, 19 May 2016 18:54:29 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:34068) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3Wpj-0007FR-MA; Thu, 19 May 2016 18:54:23 -0400 Received: by mail-wm0-x241.google.com with SMTP id n129so24860573wmn.1; Thu, 19 May 2016 15:54:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LjSauutcpT4C8kCDw9utt1h5dl24a7JJRJgl/PSGf3s=; b=S3LNTxrmrewUvj4gPHIAdBmM6azduT0IF+JLH3gfW3ozp+18A2ACfhWt/gNLzAzrS5 fwAAv4OmbnjIu6l3JghCiVsHwZrcEQRYj/L4tmA2B0u6YqM7J8FV/Y3GvKWtYqtl1wiS fD6C075egsGn2U/9fhVE11hDZAnzXONwLIgunnyWAXpIHJdnyDCSAYh1k3RWOYYnPCBQ gHwEwZquFs1ug1bzMgSJiLeJqQU1jRa9xenmcCcC8c7YRci4ASdNdJY1lhsr/cm35oJi +TEKQPmI/eKfE8kD7FzCTvYAqu/i5Q7Ux4Z3mt2a1uOd27gG3c9VyIXpLqZLS7da5Aog vdmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LjSauutcpT4C8kCDw9utt1h5dl24a7JJRJgl/PSGf3s=; b=DI6sAAP94wG7YH4K1pbwrIJqOndCFbN8WLvpMgOvc/g6iSGWDbLFGVt100GCbRewAU tQGb1iC+B/Ijdq5NPY3O9XbEPPiJkHDnFwedKNhAc96LoQIUV9KKWGC2Hx/5ZcIkrzUf ceGaYqfCG72jfsi0gHOTJ1dqBm+74F0RPXnYM2F5Qkd+umxJz60VemMqvnGr+5JJRWkN /uuhbUlzvc5itMmKQ+yHZKaoTBG82jWRF0Hi4qOM0tM3oEpfCY4wKa22ou1ju13VfAZf P7a3XW8aUsNSEDkTvlPXUXJs7KUks2wcy21RYP33Qnv5Rc8xRyA6myPmjCYnFvQ5l5mw z3Zw== X-Gm-Message-State: AOPr4FUtd0/mejczy1szDUQPZxUoQFOyeAsGpW0X/m7BaEYxSCKnGsL5H4H3loGNT/+nVg== X-Received: by 10.28.57.137 with SMTP id g131mr224275wma.5.1463698462924; Thu, 19 May 2016 15:54:22 -0700 (PDT) Received: from localhost (81-231-233-234-no56.tbcn.telia.com. [81.231.233.234]) by smtp.gmail.com with ESMTPSA id 63sm1538898wmz.5.2016.05.19.15.54.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 May 2016 15:54:22 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Fri, 20 May 2016 00:54:15 +0200 Message-Id: <1463698459-31312-2-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1463698459-31312-1-git-send-email-edgar.iglesias@gmail.com> References: <1463698459-31312-1-git-send-email-edgar.iglesias@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PATCH v1 1/5] xlnx-zynqmp: Add a secure prop to en/disable ARM Security Extensions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@xilinx.com, peter.maydell@linaro.org, crosthwaite.peter@gmail.com, qemu-arm@nongnu.org, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: "Edgar E. Iglesias" Add a secure prop to en/disable ARM Security Extensions. This is particulary useful for KVM runs. Default to disabled to match the behavior of KVM. Signed-off-by: Edgar E. Iglesias --- hw/arm/xlnx-zynqmp.c | 3 +++ include/hw/arm/xlnx-zynqmp.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c index 4d504da..965a250 100644 --- a/hw/arm/xlnx-zynqmp.c +++ b/hw/arm/xlnx-zynqmp.c @@ -238,6 +238,8 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp) } g_free(name); + object_property_set_bool(OBJECT(&s->apu_cpu[i]), + s->secure, "has_el3", NULL); object_property_set_int(OBJECT(&s->apu_cpu[i]), GIC_BASE_ADDR, "reset-cbar", &error_abort); object_property_set_bool(OBJECT(&s->apu_cpu[i]), true, "realized", @@ -370,6 +372,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp) static Property xlnx_zynqmp_props[] = { DEFINE_PROP_STRING("boot-cpu", XlnxZynqMPState, boot_cpu), + DEFINE_PROP_BOOL("secure", XlnxZynqMPState, secure, false), DEFINE_PROP_END_OF_LIST() }; diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h index 2332596..38d4c8c 100644 --- a/include/hw/arm/xlnx-zynqmp.h +++ b/include/hw/arm/xlnx-zynqmp.h @@ -84,6 +84,9 @@ typedef struct XlnxZynqMPState { char *boot_cpu; ARMCPU *boot_cpu_ptr; + + /* Has the ARM Security extensions? */ + bool secure; } XlnxZynqMPState; #define XLNX_ZYNQMP_H