x86/vvmx: correctly emulate VMWRITE
authorSergey Dyasli <sergey.dyasli@citrix.com>
Mon, 13 Feb 2017 14:21:09 +0000 (14:21 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 14 Feb 2017 10:25:18 +0000 (10:25 +0000)
commitd18216a0c03cc022d5a7c2d00a772d811c7726dd
tree1db73d1307a8e13a014de637ace9f8a73e7b56a9
parent195ca0e1de85163cb6a5d547d424f3f7c70f40d3
x86/vvmx: correctly emulate VMWRITE

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

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

A new safe versions of set_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