From patchwork Mon Jul 4 11:45:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergej Proskurin X-Patchwork-Id: 9212423 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 C9DC860572 for ; Mon, 4 Jul 2016 11:49:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC13A286DE for ; Mon, 4 Jul 2016 11:49:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF905286E2; Mon, 4 Jul 2016 11:49:22 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 28197286DE for ; Mon, 4 Jul 2016 11:49:22 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bK2LH-0008CH-W3; Mon, 04 Jul 2016 11:47:11 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bK2KS-0007wf-1O for xen-devel@lists.xenproject.org; Mon, 04 Jul 2016 11:46:20 +0000 Received: from [85.158.137.68] by server-8.bemta-3.messagelabs.com id 41/70-03780-B8C4A775; Mon, 04 Jul 2016 11:46:19 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMLMWRWlGSWpSXmKPExsXSPJ+BQ7fLpyr cYNsMNYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNaNn9wW2ggaJihNrLrM1MM4Q6WLk4hAS2Mgo sebGITYIZzmjxKXzV5m7GDk52AQMJKa8XskKYosIKEncWzWZCaSIWaCJUeJe4wM2kISwgJfEg 5kNYEUsAqoSK279YwSxeQVsJFZ/+c4EYksIyElMXnwJLM4pYCvR0PEJLC4EVNN99zHbBEbuBY wMqxjVi1OLylKLdC31kooy0zNKchMzc3QNDYz1clOLixPTU3MSk4r1kvNzNzECPVzPwMC4g/H 1T6dDjJIcTEqivOnuVeFCfEn5KZUZicUZ8UWlOanFhxhlODiUJHh9vIFygkWp6akVaZk5wFCD SUtw8CiJ8JqApHmLCxJzizPTIVKnGHU5js29sZZJiCUvPy9VSpzXD6RIAKQoozQPbgQs7C8xy koJ8zIyMDAI8RSkFuVmlqDKv2IU52BUEuaVAJnCk5lXArfpFdARTEBHsMaWgxxRkoiQkmpgzL CTf9a7XJzpT6c+o/4sHt441QIGiWNhv2X2XYhn6lKoO35DRysjqLRpf2uL+KYnV3VabStW/Eu Namd6yh1z683TD5MbeA/ydd903vEtZP2U8sdbuWTTGL5OuvOxouTSLJbIItt3vALXkoU7RLnP PS9sFUs5PadxYZv2i33Wto+ypaXZt99UYinOSDTUYi4qTgQA0btH8XYCAAA= X-Env-Sender: proskurin@sec.in.tum.de X-Msg-Ref: server-7.tower-31.messagelabs.com!1467632778!41190768!1 X-Originating-IP: [131.159.0.8] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 19423 invoked from network); 4 Jul 2016 11:46:18 -0000 Received: from mail-out1.informatik.tu-muenchen.de (HELO mail-out1.informatik.tu-muenchen.de) (131.159.0.8) by server-7.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 4 Jul 2016 11:46:18 -0000 Received: from files.sec.in.tum.de (files.sec.in.tum.de [131.159.50.1]) by services.sec.in.tum.de (Postfix) with ESMTP id 3F16E100D1FAF; Mon, 4 Jul 2016 13:46:18 +0200 (CEST) Received: from ker.sec.in.tum.de (ker.sec.in.tum.de [131.159.50.36]) by files.sec.in.tum.de (Postfix) with ESMTP id 3289F2EEF; Mon, 4 Jul 2016 13:46:18 +0200 (CEST) From: Sergej Proskurin To: xen-devel@lists.xenproject.org Date: Mon, 4 Jul 2016 13:45:30 +0200 Message-Id: <20160704114605.10086-2-proskurin@sec.in.tum.de> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20160704114605.10086-1-proskurin@sec.in.tum.de> References: <20160704114605.10086-1-proskurin@sec.in.tum.de> X-Mailman-Approved-At: Mon, 04 Jul 2016 11:47:10 +0000 Cc: Sergej Proskurin , Julien Grall , Stefano Stabellini Subject: [Xen-devel] [PATCH 01/18] arm/altp2m: Add cmd-line support for altp2m on ARM. X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP The Xen altp2m subsystem is currently supported only on x86-64 based architectures. By utilizing ARM's virtualization extensions, we intend to implement altp2m support for ARM architectures and thus further extend current Virtual Machine Introspection (VMI) capabilities on ARM. With this commit, Xen is now able to activate altp2m support on ARM by means of the command-line argument 'altp2m' (bool). Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- xen/arch/arm/hvm.c | 22 ++++++++++++++++++++ xen/include/asm-arm/hvm/hvm.h | 47 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 xen/include/asm-arm/hvm/hvm.h diff --git a/xen/arch/arm/hvm.c b/xen/arch/arm/hvm.c index d999bde..3615036 100644 --- a/xen/arch/arm/hvm.c +++ b/xen/arch/arm/hvm.c @@ -32,6 +32,28 @@ #include +#include + +/* Xen command-line option enabling altp2m */ +static bool_t __initdata opt_altp2m_enabled = 0; +boolean_param("altp2m", opt_altp2m_enabled); + +struct hvm_function_table hvm_funcs __read_mostly = { + .name = "ARM_HVM", +}; + +/* Initcall enabling hvm functionality. */ +static int __init hvm_enable(void) +{ + if ( opt_altp2m_enabled ) + hvm_funcs.altp2m_supported = 1; + else + hvm_funcs.altp2m_supported = 0; + + return 0; +} +presmp_initcall(hvm_enable); + long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg) { long rc = 0; diff --git a/xen/include/asm-arm/hvm/hvm.h b/xen/include/asm-arm/hvm/hvm.h new file mode 100644 index 0000000..96c455c --- /dev/null +++ b/xen/include/asm-arm/hvm/hvm.h @@ -0,0 +1,47 @@ +/* + * include/asm-arm/hvm/hvm.h + * + * Copyright (c) 2016, Sergej Proskurin + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, version 2, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; If not, see . + */ + +#ifndef __ASM_ARM_HVM_HVM_H__ +#define __ASM_ARM_HVM_HVM_H__ + +struct hvm_function_table { + char *name; + + /* Necessary hardware support for alternate p2m's. */ + bool_t altp2m_supported; +}; + +extern struct hvm_function_table hvm_funcs; + +/* Returns true if hardware supports alternate p2m's */ +static inline bool_t hvm_altp2m_supported(void) +{ + return hvm_funcs.altp2m_supported; +} + +#endif /* __ASM_ARM_HVM_HVM_H__ */ + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */