x86/vmx: improve vmread_safe()
authorSergey Dyasli <sergey.dyasli@citrix.com>
Thu, 9 Feb 2017 10:07:31 +0000 (11:07 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 9 Feb 2017 10:07:31 +0000 (11:07 +0100)
commit1edbf34e63c8c286137591f8574c0bf9a4221312
treed986d81987d7829e6a8d14760b582fd5910883f6
parentd4a24c64b60dc265778419e925382d8b817908f9
x86/vmx: improve vmread_safe()

The original function doesn't distinguish between Valid and Invalid
VMfails.  Improved function returns error code depending on the outcome:

        VMsucceed: 0
      VMfailValid: VM Instruction Error Number
    VMfailInvalid: VMX_INSN_FAIL_INVALID (~0)

Existing users of __vmread_safe() are updated and double underscore
prefix is removed from the function's name because such prefixes are
reserved to a compiler.

Signed-off-by: Sergey Dyasli <sergey.dyasli@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/hvm/vmx/vmcs.c
xen/arch/x86/hvm/vmx/vvmx.c
xen/include/asm-x86/hvm/vmx/vmx.h