Message ID | 20170213142110.26467-2-sergey.dyasli@citrix.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
>>> On 13.02.17 at 15:21, <sergey.dyasli@citrix.com> wrote: > 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@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> From: Sergey Dyasli [mailto:sergey.dyasli@citrix.com] > Sent: Monday, February 13, 2017 10:21 PM > > 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@citrix.com> Acked-by: Kevin Tian <kevin.tian@intel.com>
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 3eb11e7..005e7e1 100644 --- a/xen/include/asm-x86/hvm/vmx/vmcs.h +++ b/xen/include/asm-x86/hvm/vmx/vmcs.h @@ -514,6 +514,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",
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@citrix.com> --- 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(-)