mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Acked-by: Kevin Tian <kevin.tian@intel.com>
This commit is contained in:
1 parent
28722e98f7
commit
195ca0e1de
3 files changed
+6
-2
No files matched your search
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
|
||||