[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] x86/vmx: introduce VMX_INSN_SUCCEED
commit 195ca0e1de85163cb6a5d547d424f3f7c70f40d3 Author: Sergey Dyasli <sergey.dyasli@xxxxxxxxxx> AuthorDate: Mon Feb 13 14:21:08 2017 +0000 Commit: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> CommitDate: Tue Feb 14 10:25:05 2017 +0000 x86/vmx: introduce VMX_INSN_SUCCEED The new value corresponds to VMsucceed status of VMX instructions. This will replace usage of literal zeroes in related functions. Update vmfail(), vmread_safe() and vmwrite_safe(). Signed-off-by: Sergey Dyasli <sergey.dyasli@xxxxxxxxxx> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx> Acked-by: Kevin Tian <kevin.tian@xxxxxxxxx> --- xen/arch/x86/hvm/vmx/vvmx.c | 3 +++ xen/include/asm-x86/hvm/vmx/vmcs.h | 1 + xen/include/asm-x86/hvm/vmx/vmx.h | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c index 9c61b5b..7172621 100644 --- a/xen/arch/x86/hvm/vmx/vvmx.c +++ b/xen/arch/x86/hvm/vmx/vvmx.c @@ -483,6 +483,9 @@ static void vmfail_invalid(struct cpu_user_regs *regs) static void vmfail(struct cpu_user_regs *regs, enum vmx_insn_errno errno) { + if ( errno == VMX_INSN_SUCCEED ) + return; + if ( vcpu_nestedhvm(current).nv_vvmcxaddr != INVALID_PADDR && errno != VMX_INSN_FAIL_INVALID ) vmfail_valid(regs, errno); diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h index b6b665b..35b0430 100644 --- a/xen/include/asm-x86/hvm/vmx/vmcs.h +++ b/xen/include/asm-x86/hvm/vmx/vmcs.h @@ -513,6 +513,7 @@ enum vmcs_field { /* VM Instruction error numbers */ enum vmx_insn_errno { + VMX_INSN_SUCCEED = 0, VMX_INSN_VMCLEAR_INVALID_PHYADDR = 2, VMX_INSN_VMLAUNCH_NONCLEAR_VMCS = 4, VMX_INSN_VMRESUME_NONLAUNCHED_VMCS = 5, diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h index f4183d9..17e6342 100644 --- a/xen/include/asm-x86/hvm/vmx/vmx.h +++ b/xen/include/asm-x86/hvm/vmx/vmx.h @@ -404,7 +404,7 @@ static always_inline void __vmwrite(unsigned long field, unsigned long value) static inline enum vmx_insn_errno vmread_safe(unsigned long field, unsigned long *value) { - unsigned long ret = 0; + unsigned long ret = VMX_INSN_SUCCEED; bool fail_invalid, fail_valid; asm volatile ( GAS_VMX_OP("vmread %[field], %[value]\n\t", @@ -427,7 +427,7 @@ static inline enum vmx_insn_errno vmread_safe(unsigned long field, static inline enum vmx_insn_errno vmwrite_safe(unsigned long field, unsigned long value) { - unsigned long ret = 0; + unsigned long ret = VMX_INSN_SUCCEED; bool fail_invalid, fail_valid; asm volatile ( GAS_VMX_OP("vmwrite %[value], %[field]\n\t", -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |