From patchwork Thu Jan 5 18:42:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshul Makkar X-Patchwork-Id: 9499447 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 67761606B5 for ; Thu, 5 Jan 2017 18:45:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6278428399 for ; Thu, 5 Jan 2017 18:45:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5547D28427; Thu, 5 Jan 2017 18:45:12 +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 02D7A28399 for ; Thu, 5 Jan 2017 18:45:11 +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 1cPCzw-000388-7x; Thu, 05 Jan 2017 18:42: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 1cPCzu-000382-Of for xen-devel@lists.xen.org; Thu, 05 Jan 2017 18:42:46 +0000 Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id B0/88-18129-5A39E685; Thu, 05 Jan 2017 18:42:45 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLLMWRWlGSWpSXmKPExsXitHRDpO7SyXk RBof2SVks+biYxYHR4+ju30wBjFGsmXlJ+RUJrBlHZ75iKZjDUbHs2wrmBsZGti5GTg4JAX+J y/eOMYPYbAJ6Ekdu/WEHsUUEZCVWd80Bsrk4mAUmMkps+POXsYuRg0NYQFuibS1YPYuAisSVG y/A6nkFPCSOfTrADDFTTuLmuU4wW0hAVaL32SEmiBpBiZMzn7CA2MwCEhIHX7xgnsDIPQtJah aS1AJGplWMGsWpRWWpRbqG5npJRZnpGSW5iZk5uoYGpnq5qcXFiempOYlJxXrJ+bmbGIHBwAA EOxgvnvY8xCjJwaQkyjunMi9CiC8pP6UyI7E4I76oNCe1+BCjDAeHkgSv/wSgnGBRanpqRVpm DjAsYdISHDxKIrwJ/UBp3uKCxNzizHSI1ClGRSlx3nyQPgGQREZpHlwbLBYuMcpKCfMyAh0ix FOQWpSbWYIq/4pRnINRSZjXBmQ8T2ZeCdz0V0CLmYAWbw/IBllckoiQkmpgjJC98Jf9pf5/40 ezvq7M+bPm8Pp4k5rw9sVcDKcSbjUpPnP4vOBWTMNrnVTdziqZjrXvgwNnRemxPnl0WV+AT3P a3klWAiIqCz/drnuVtUbGsqSo5Yvwa//kSZfa+2t3p/M9LpF+Hph074g69+5F2nl9a7OevzKb 2OtYMTn03Kx7v144HX9oq8RSnJFoqMVcVJwIAJg4o/+AAgAA X-Env-Sender: prvs=171829514=anshul.makkar@citrix.com X-Msg-Ref: server-7.tower-206.messagelabs.com!1483641763!78395805!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 58038 invoked from network); 5 Jan 2017 18:42:45 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-7.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 5 Jan 2017 18:42:45 -0000 X-IronPort-AV: E=Sophos;i="5.33,322,1477958400"; d="scan'208";a="398183824" From: Anshul Makkar To: Date: Thu, 5 Jan 2017 18:42:17 +0000 Message-ID: <1483641737-26941-1-git-send-email-anshul.makkar@citrix.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Cc: andrew.cooper3@citrix.com, kevin.tian@intel.com, jbeulich@suse.com, jun.nakajima@intel.com, Anshul Makkar Subject: [Xen-devel] [PATCH] x86/VMX: Implement vmptrst 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: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Current codebase doesn't implement and use vmptrst. Implementing it as it may be required in future. Signed-off-by: Anshul Makkar --- xen/include/asm-x86/hvm/vmx/vmx.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h index e5c6499..2db6c1d 100644 --- a/xen/include/asm-x86/hvm/vmx/vmx.h +++ b/xen/include/asm-x86/hvm/vmx/vmx.h @@ -328,6 +328,28 @@ static always_inline void __vmptrld(u64 addr) : "memory"); } +static always_inline u64 __vmptrst(void) +{ + u64 paddr; + + asm volatile ( +#ifdef HAVE_GAS_VMX + "vmptrst %0\n" +#else + VMPTRST_OPCODE MODRM_EAX_07 +#endif + +#ifdef HAVE_GAS_VMX + : "=m" (paddr) + : +#else + : + : "a" (&paddr), +#endif + : "memory"); + return paddr; +} + static always_inline void __vmpclear(u64 addr) { asm volatile (