From: Wei Huang Subject: [PATCH 3/3] HVM: Support XSAVE/XRSTOR and AVX for AMD CPUs Date: Fri, 3 Dec 2010 09:43:46 -0600 Message-ID: <1291391026.1867.28.camel@weilaptop> Reply-To: wei.huang2@amd.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-uygd5N+kNPwdwkguaqi7" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: keir@xen.org List-Id: xen-devel@lists.xenproject.org --=-uygd5N+kNPwdwkguaqi7 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Enable SVM intercept for xsetbv instruction. SVM introduces an intercept control bit for xsetbv instruction. This patches enables xsetbv intercept for SVM. Signed-off-by: Wei Huang --=-uygd5N+kNPwdwkguaqi7 Content-Disposition: attachment; filename="amd_xsave_support_patch_3.txt" Content-Type: text/plain; name="amd_xsave_support_patch_3.txt"; charset="UTF-8" Content-Transfer-Encoding: 7bit Content-Description: amd_xsave_support_patch_3.txt diff -r c3afa05c3cb5 -r dac9e358bc4a xen/arch/x86/hvm/svm/emulate.c --- a/xen/arch/x86/hvm/svm/emulate.c Thu Dec 02 11:08:21 2010 -0600 +++ b/xen/arch/x86/hvm/svm/emulate.c Thu Dec 02 17:42:40 2010 -0600 @@ -76,7 +76,7 @@ /* (exitcodes 84-95) are reserved */ case VMEXIT_IDTR_READ ... VMEXIT_TR_WRITE: case VMEXIT_RDTSC ... VMEXIT_MSR: - case VMEXIT_VMRUN ... VMEXIT_MWAIT_CONDITIONAL: + case VMEXIT_VMRUN ... VMEXIT_XSETBV: /* ...and the rest of the #VMEXITs */ case VMEXIT_CR0_SEL_WRITE: case VMEXIT_EXCEPTION_BP: diff -r c3afa05c3cb5 -r dac9e358bc4a xen/arch/x86/hvm/svm/vmcb.c --- a/xen/arch/x86/hvm/svm/vmcb.c Thu Dec 02 11:08:21 2010 -0600 +++ b/xen/arch/x86/hvm/svm/vmcb.c Thu Dec 02 17:42:40 2010 -0600 @@ -127,7 +127,8 @@ GENERAL2_INTERCEPT_VMLOAD | GENERAL2_INTERCEPT_VMSAVE | GENERAL2_INTERCEPT_STGI | GENERAL2_INTERCEPT_CLGI | GENERAL2_INTERCEPT_SKINIT | GENERAL2_INTERCEPT_MWAIT | - GENERAL2_INTERCEPT_WBINVD | GENERAL2_INTERCEPT_MONITOR; + GENERAL2_INTERCEPT_WBINVD | GENERAL2_INTERCEPT_MONITOR | + GENERAL2_INTERCEPT_XSETBV; /* Intercept all debug-register writes. */ vmcb->dr_intercepts = ~0u; diff -r c3afa05c3cb5 -r dac9e358bc4a xen/include/asm-x86/hvm/svm/vmcb.h --- a/xen/include/asm-x86/hvm/svm/vmcb.h Thu Dec 02 11:08:21 2010 -0600 +++ b/xen/include/asm-x86/hvm/svm/vmcb.h Thu Dec 02 17:42:40 2010 -0600 @@ -76,7 +76,8 @@ GENERAL2_INTERCEPT_WBINVD = 1 << 9, GENERAL2_INTERCEPT_MONITOR = 1 << 10, GENERAL2_INTERCEPT_MWAIT = 1 << 11, - GENERAL2_INTERCEPT_MWAIT_CONDITIONAL = 1 << 12 + GENERAL2_INTERCEPT_MWAIT_CONDITIONAL = 1 << 12, + GENERAL2_INTERCEPT_XSETBV = 1 << 13 }; --=-uygd5N+kNPwdwkguaqi7 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-uygd5N+kNPwdwkguaqi7--