From patchwork Thu May 18 15:07:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Pop X-Patchwork-Id: 9734649 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 0EA7A600CC for ; Thu, 18 May 2017 15:10:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2A2F28833 for ; Thu, 18 May 2017 15:10:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E782428851; Thu, 18 May 2017 15:10:44 +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 8C60428833 for ; Thu, 18 May 2017 15:10:44 +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 1dBN2m-0008Lb-WA; Thu, 18 May 2017 15:08:48 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dBN2l-0008Kh-TX for xen-devel@lists.xenproject.org; Thu, 18 May 2017 15:08:48 +0000 Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id 2C/AC-01734-FF8BD195; Thu, 18 May 2017 15:08:47 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLIsWRWlGSWpSXmKPExsUSfTxjoe6/HbK RBt+nKFt83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBnLl39jL7gvWLHg0AfGBsZvvF2MnBxCAm4S i45cZuxi5AKy1zJKvG6YzQThXGCU+ND7lgmiykNi1tx+Zgh7N6NE7+QYEJtNQF1i894trCC2i ICSxL1Vk8GamQUOMkm0PXgP1iws4Cnx7d4NMJtFQFWi4dFZNhCbV8BCYuX7dhYQW0JAXuLslp 1gCzgFLCWW7LvGCLHMQmLnmz6gXg6gmhyJ85vUIUwpif+tSiCrJAT6WCT+vt7BBDFGRuLRxJt sExiFFjAyrGLUKE4tKkst0jWy1EsqykzPKMlNzMzRNTQw1ctNLS5OTE/NSUwq1kvOz93ECAzE egYGxh2Ml7f4HWKU5GBSEuU9XCAbKcSXlJ9SmZFYnBFfVJqTWnyIUYaDQ0mC9/d2oJxgUWp6a kVaZg4wJmDSEhw8SiK8b0DSvMUFibnFmekQqVOMxhzvln54z8Sxr/XjeyYhlrz8vFQpcd4HIK UCIKUZpXlwg2CxeolRVkqYl5GBgUGIpyC1KDezBFX+FaM4B6OSMMRCnsy8Erh9r4BOYQI6pfm BNMgpJYkIKakGRsMt3Jf3CM499FXiaImNlBXHy3PO//msmJf/kD+4eedl74AZj3et0HdJ31T/ 49Bhfb9pCveUnol8XcjnfKE6l9n+sFBN8/GQ18EbqutbPFfJGP3Ikbb89KDUX5ObY0GXzMfNw rmL/RvCZ/2sdfdOm7Q/20zg+guTzhsbVu77OT089J2voLjfYiWW4oxEQy3mouJEAFwOUevQAg AA X-Env-Sender: apop@bitdefender.com X-Msg-Ref: server-12.tower-206.messagelabs.com!1495120126!62731345!1 X-Originating-IP: [91.199.104.161] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.12; banners=-,-,- X-VirusChecked: Checked Received: (qmail 23936 invoked from network); 18 May 2017 15:08:46 -0000 Received: from mx01.bbu.dsd.mx.bitdefender.com (HELO mx01.bbu.dsd.mx.bitdefender.com) (91.199.104.161) by server-12.tower-206.messagelabs.com with DHE-RSA-AES128-GCM-SHA256 encrypted SMTP; 18 May 2017 15:08:46 -0000 Received: (qmail 516 invoked from network); 18 May 2017 18:08:45 +0300 Received: from unknown (HELO mx-sr.buh.bitdefender.com) (10.17.80.103) by mx01.bbu.dsd.mx.bitdefender.com with AES256-GCM-SHA384 encrypted SMTP; 18 May 2017 18:08:45 +0300 Received: from smtp03.buh.bitdefender.org (unknown [10.17.80.77]) by mx-sr.buh.bitdefender.com (Postfix) with ESMTP id 9584980F4B for ; Thu, 18 May 2017 18:08:45 +0300 (EEST) Received: (qmail 25442 invoked from network); 18 May 2017 18:08:10 +0300 Received: from unknown (HELO hel.clj.bitdefender.biz) (apop@bitdefender.com@10.220.12.75) by smtp03.buh.bitdefender.org with AES128-GCM-SHA256 encrypted SMTP; 18 May 2017 18:08:10 +0300 From: Adrian Pop To: xen-devel@lists.xenproject.org Date: Thu, 18 May 2017 18:07:58 +0300 Message-Id: <20170518150758.9414-4-apop@bitdefender.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170518150758.9414-1-apop@bitdefender.com> References: <20170518150758.9414-1-apop@bitdefender.com> X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.6 on smtp03.buh.bitdefender.org, sigver: 7.71440 X-BitDefender-Spam: No (0) X-BitDefender-SpamStamp: Build: [Engines: 2.15.8.1074, Dats: 449447, Stamp: 3], Multi: [Enabled, t: (0.000011, 0.012448)], BW: [Enabled, t: (0.000010)], RBL DNSBL: [Disabled], APM: [Enabled, Score: 500, t: (0.004125), Flags: 85D2ED72; NN_NO_CONTENT_TYPE; NN_NO_LINK_NMD; NN_LEGIT_BITDEFENDER; NN_LEGIT_S_SQARE_BRACKETS; NN_LEGIT_MAILING_LIST_TO], SGN: [Enabled, t: (0.008958,0.000121)], URL: [Enabled, t: (0.000008)], RTDA: [Enabled, t: (0.316214), Hit: No, Details: v2.4.9; Id: 15.5f4g83.1bfmq1kdh.b8gkn], total: 0(775) X-BitDefender-CF-Stamp: none Cc: Tamas K Lengyel , Wei Liu , Razvan Cojocaru , Adrian Pop , George Dunlap , Andrew Cooper , Ian Jackson , Jan Beulich Subject: [Xen-devel] [PATCH 3/3] libxc: Add support for the altp2m suppress #VE hvmop 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 This adds a wrapper for issuing HVMOP_altp2m_set_suppress_ve from a domain. Signed-off-by: Adrian Pop --- tools/libxc/include/xenctrl.h | 2 ++ tools/libxc/xc_altp2m.c | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h index 2d97d36c38..5e1e4cfa81 100644 --- a/tools/libxc/include/xenctrl.h +++ b/tools/libxc/include/xenctrl.h @@ -1923,6 +1923,8 @@ int xc_altp2m_destroy_view(xc_interface *handle, domid_t domid, /* Switch all vCPUs of the domain to the specified altp2m view */ int xc_altp2m_switch_to_view(xc_interface *handle, domid_t domid, uint16_t view_id); +int xc_altp2m_set_suppress_ve(xc_interface *handle, domid_t domid, + uint16_t view_id, xen_pfn_t gfn, uint8_t sve); int xc_altp2m_set_mem_access(xc_interface *handle, domid_t domid, uint16_t view_id, xen_pfn_t gfn, xenmem_access_t access); diff --git a/tools/libxc/xc_altp2m.c b/tools/libxc/xc_altp2m.c index 0639632477..b0f3e344af 100644 --- a/tools/libxc/xc_altp2m.c +++ b/tools/libxc/xc_altp2m.c @@ -163,6 +163,30 @@ int xc_altp2m_switch_to_view(xc_interface *handle, domid_t domid, return rc; } +int xc_altp2m_set_suppress_ve(xc_interface *handle, domid_t domid, + uint16_t view_id, xen_pfn_t gfn, uint8_t sve) +{ + int rc; + DECLARE_HYPERCALL_BUFFER(xen_hvm_altp2m_op_t, arg); + + arg = xc_hypercall_buffer_alloc(handle, arg, sizeof(*arg)); + if ( arg == NULL ) + return -1; + + arg->version = HVMOP_ALTP2M_INTERFACE_VERSION; + arg->cmd = HVMOP_altp2m_set_suppress_ve; + arg->domain = domid; + arg->u.set_suppress_ve.view = view_id; + arg->u.set_suppress_ve.gfn = gfn; + arg->u.set_suppress_ve.suppress_ve = sve; + + rc = xencall2(handle->xcall, __HYPERVISOR_hvm_op, HVMOP_altp2m, + HYPERCALL_BUFFER_AS_ARG(arg)); + + xc_hypercall_buffer_free(handle, arg); + return rc; +} + int xc_altp2m_set_mem_access(xc_interface *handle, domid_t domid, uint16_t view_id, xen_pfn_t gfn, xenmem_access_t access)