HVM: Support XSAVE/XRSTOR and AVX for AMD CPUs
PATCH 3/3 HVM: Support XSAVE/XRSTOR and AVX for AMD CPUs
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 <[email protected]>
xen/arch/x86/hvm/svm/emulate.c +1 -1
@@ -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 :
xen/arch/x86/hvm/svm/vmcb.c +2 -1
@@ -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 ;
xen/include/asm-x86/hvm/svm/vmcb.h +2 -1
@@ -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 };
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel