x86/vvmx: correctly emulate VMREAD
authorSergey Dyasli <sergey.dyasli@citrix.com>
Mon, 13 Feb 2017 14:21:10 +0000 (14:21 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 14 Feb 2017 10:25:27 +0000 (10:25 +0000)
commit62c7b99a10793738db1007f6750cf79057625f2c
tree9226226dae9938cabe740baed284a99fe0d0a2a6
parentd18216a0c03cc022d5a7c2d00a772d811c7726dd
x86/vvmx: correctly emulate VMREAD

There is an issue with the original __vmread() in nested vmx mode:
emulation of a guest's VMREAD with invalid arguments leads to BUG().

Fix this by using vmread_safe() and reporting any kind of VMfail back
to the guest.

A new safe versions of get_vvmcs() macro and related functions are
introduced because of new function signatures and lots of existing
users.

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/vmcs.h
xen/include/asm-x86/hvm/vmx/vvmx.h