From patchwork Thu Oct 26 17:03:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Euan Harris X-Patchwork-Id: 10028641 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 D6D1D601E8 for ; Thu, 26 Oct 2017 17:06:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C30F728E75 for ; Thu, 26 Oct 2017 17:06:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B7A4528E81; Thu, 26 Oct 2017 17:06:17 +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 194C528E75 for ; Thu, 26 Oct 2017 17:06:15 +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 1e7lZh-0002kj-St; Thu, 26 Oct 2017 17:04:09 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e7lZg-0002iR-83 for xen-devel@lists.xenproject.org; Thu, 26 Oct 2017 17:04:08 +0000 Received: from [193.109.254.147] by server-9.bemta-6.messagelabs.com id EA/3E-30115-88512F95; Thu, 26 Oct 2017 17:04:08 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprGIsWRWlGSWpSXmKPExsXitHRDpG676Kd IgwM/NSy+b5nM5MDocfjDFZYAxijWzLyk/IoE1owtM/ewFUwXrNhy4j9zA2MjbxcjJ4eEgL/E 64NT2UBsNgEtid0fFrJ3MXJwiAioSNzea9DFyMXBLNDLKLH0/QUmkBphAXOJb9OuMIPYLAKqE te/vmUBqecVcJP4+9UMYqSCxJSH78FKOAXcJQ4t3AQ2Xgio5OK3X6wQtrLEhytr2EFsXgFBiZ Mzn7CA2MwCEhIHX7xgnsDIOwtJahaS1AJGplWMGsWpRWWpRbpGlnpJRZnpGSW5iZk5uoYGZnq 5qcXFiempOYlJxXrJ+bmbGIGhwwAEOxgPLAo8xCjJwaQkysuw50OkEF9SfkplRmJxRnxRaU5q 8SFGGQ4OJQleWZFPkUKCRanpqRVpmTnAIIZJS3DwKInwdoCkeYsLEnOLM9MhUqcYjTk6bt79w 8TxbObrBmYhlrz8vFQpcV5TkFIBkNKM0jy4QbDousQoKyXMywh0mhBPQWpRbmYJqvwrRnEORi Vh3maQKTyZeSVw+14BncIEdEqT6geQU0oSEVJSDYwHu6o7pV4+/u8ctPjJb0uX1A7TjOsHjRP u9LLePysqlbe3PCGtuELJ986uV0VBzU8s03T5O38tXeQtfykizGP1z9enj9eveNQ6t+WhzSnP xTtjee/ZbtG8eOL19G2ymxKPPFlw5tDm4B373aUtao5XNU7kKdM5JnN611zmfQskNrZOTm0Oy TZQYinOSDTUYi4qTgQAFRjz76kCAAA= X-Env-Sender: prvs=465eced58=euan.harris@citrix.com X-Msg-Ref: server-7.tower-27.messagelabs.com!1509037444!108999864!2 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.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 48523 invoked from network); 26 Oct 2017 17:04:07 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-7.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 26 Oct 2017 17:04:07 -0000 X-IronPort-AV: E=Sophos;i="5.44,301,1505779200"; d="scan'208";a="448413591" From: Euan Harris To: Date: Thu, 26 Oct 2017 18:03:11 +0100 Message-ID: <1509037399-48926-2-git-send-email-euan.harris@citrix.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1509037399-48926-1-git-send-email-euan.harris@citrix.com> References: <1509037399-48926-1-git-send-email-euan.harris@citrix.com> MIME-Version: 1.0 Cc: andrew.cooper3@citrix.com, kevin.tian@intel.com, Euan Harris , jun.nakajima@intel.com, jbeulich@suse.com Subject: [Xen-devel] [PATCH 1/9] x86/vvmx: Remove enum vmx_regs_enc 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 This is the standard register encoding, is not VVMX-specific and is only used in a couple of places. Signed-off-by: Euan Harris --- xen/arch/x86/hvm/vmx/vvmx.c | 8 ++++---- xen/include/asm-x86/hvm/vmx/vvmx.h | 22 ---------------------- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c index dde02c076b..9d87786894 100644 --- a/xen/arch/x86/hvm/vmx/vvmx.c +++ b/xen/arch/x86/hvm/vmx/vvmx.c @@ -201,10 +201,10 @@ struct vmx_inst_decoded { unsigned long mem; unsigned int len; }; - enum vmx_regs_enc reg1; + unsigned int reg1; }; - enum vmx_regs_enc reg2; + unsigned int reg2; }; enum vmx_ops_result { @@ -345,7 +345,7 @@ enum vmx_insn_errno set_vvmcs_real_safe(const struct vcpu *v, u32 encoding, } static unsigned long reg_read(struct cpu_user_regs *regs, - enum vmx_regs_enc index) + unsigned int index) { unsigned long *pval = decode_register(index, regs, 0); @@ -353,7 +353,7 @@ static unsigned long reg_read(struct cpu_user_regs *regs, } static void reg_write(struct cpu_user_regs *regs, - enum vmx_regs_enc index, + unsigned int index, unsigned long value) { unsigned long *pval = decode_register(index, regs, 0); diff --git a/xen/include/asm-x86/hvm/vmx/vvmx.h b/xen/include/asm-x86/hvm/vmx/vvmx.h index 3285b03bbb..9ea35eb795 100644 --- a/xen/include/asm-x86/hvm/vmx/vvmx.h +++ b/xen/include/asm-x86/hvm/vmx/vvmx.h @@ -64,28 +64,6 @@ struct nestedvmx { /* bit 0-8, and 12 must be 1 */ #define VMX_ENTRY_CTLS_DEFAULT1 0x11ff -/* - * Encode of VMX instructions base on Table 24-11 & 24-12 of SDM 3B - */ - -enum vmx_regs_enc { - VMX_REG_RAX, - VMX_REG_RCX, - VMX_REG_RDX, - VMX_REG_RBX, - VMX_REG_RSP, - VMX_REG_RBP, - VMX_REG_RSI, - VMX_REG_RDI, - VMX_REG_R8, - VMX_REG_R9, - VMX_REG_R10, - VMX_REG_R11, - VMX_REG_R12, - VMX_REG_R13, - VMX_REG_R14, - VMX_REG_R15, -}; union vmx_inst_info { struct {