From patchwork Thu May 19 22:48:49 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: 9128389 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 6289E6048B for ; Thu, 19 May 2016 22:49:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55B6C1FF45 for ; Thu, 19 May 2016 22:49:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48E1F20265; Thu, 19 May 2016 22:49:38 +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 CF80C1FF45 for ; Thu, 19 May 2016 22:49:37 +0000 (UTC) Received: from localhost ([::1]:52390 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3Wl6-0003o1-Ve for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 May 2016 18:49:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3Wka-0003m1-HA for qemu-devel@nongnu.org; Thu, 19 May 2016 18:49:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3WkT-0006Q6-HQ for qemu-devel@nongnu.org; Thu, 19 May 2016 18:49:03 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:32999) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3WkT-0006Q2-Al; Thu, 19 May 2016 18:48:57 -0400 Received: by mail-wm0-x244.google.com with SMTP id 67so1690182wmg.0; Thu, 19 May 2016 15:48:57 -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=mnLTriC0kO/Nd3vkTl6vqR9wl+f0Hhh6hv3CjGRUZQ4OMsUztOOYQsN7CgQopItoes L8zIhSrwBddf53EDvqFUG2MscGp1oICFejbP+yni2vgANJ5Bo6dt+GXG7jQlY0BPeZjo BJ9G8AOn9UhEN+Uqn9GXNKoN1c3WNUscmXOQCdO6o6Q+AHlw2zrNeg2ly/LtKLndOdrF sWCbvRkZbY/n95gT6SRgBBuEbOP3lBbKykYgPpWcZ8xZr2XYFGYhWi6YljXWztmh1G6r MQ74gFmajujwu6Kl6EWm3ermqoWzxqtLQOwGUUTLr/xaouqKluTFDjvIFaR0qBBpgkJg 5LEQ== 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=YEGrUTt5QmfPF088x89uk2BfTVOedBy7BlgwmXueJu6DnfYkrXmAYZHpGyAir7NGCU WoKrBNrY/T5cWNFrG9eMhhlnAJhWyRY/OA9gHUkv3pJ2q4yCIKgJMyCyex+7DbkkBGNV r5Tm7EMyD6vvdsK2rnXdocLq0rXuzfcQRmnxt6wG01/F9+a1cYIgL8qixk9sSVAH3eVk hANIo7AIXxx6UvhraYtOIMeeeY93+GXnfizmc81yGepK/g72UWwiGPjXhOZOxFg6Vpyq H7ya86fqM+yppFfrAaXKfmfEtnvRbfVNIcDRFDYAA3oZw5vOfLlNoXBQJgIgK4gmBFzx iuQA== X-Gm-Message-State: AOPr4FUaSOHXMG0NssRIVHpZD51HHPSESrXvPJv6Uvoqwv601Ym5CZemI850bZnxs2t/lw== X-Received: by 10.194.234.71 with SMTP id uc7mr2265081wjc.80.1463698136635; Thu, 19 May 2016 15:48:56 -0700 (PDT) Received: from localhost (81-231-233-234-no56.tbcn.telia.com. [81.231.233.234]) by smtp.gmail.com with ESMTPSA id m140sm1453057wma.24.2016.05.19.15.48.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 May 2016 15:48:56 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Fri, 20 May 2016 00:48:49 +0200 Message-Id: <1463698133-30880-2-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1463698133-30880-1-git-send-email-edgar.iglesias@gmail.com> References: <1463698133-30880-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::244 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: peter.maydell@linaro.org, crosthwaite.peter@gmail.com, edgar.iglesiasl@xilinx.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