KVM: nVMX: do not fill vm_exit_intr_error_code in prepare_vmcs12
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 27 Jul 2017 08:31:25 +0000 (10:31 +0200)
committerRadim Krčmář <rkrcmar@redhat.com>
Tue, 1 Aug 2017 20:23:25 +0000 (22:23 +0200)
commit7313c698050387a11c21afb0c6b4c61f21f7c042
treecce6a624d4a13b4a6bcc5146baffa97f02a24554
parent16f73eb02d7e1765ccab3d2018e0bd98eb93d973
KVM: nVMX: do not fill vm_exit_intr_error_code in prepare_vmcs12

Do this in the caller of nested_vmx_vmexit instead.

nested_vmx_check_exception was doing a vmwrite to the vmcs02's
VM_EXIT_INTR_ERROR_CODE field, so that prepare_vmcs12 would move
the field to vmcs12->vm_exit_intr_error_code.  However that isn't
possible on pre-Haswell machines.  Moving the vmcs12 write to the
callers fixes it.

Reported-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[Changed nested_vmx_reflect_vmexit() return type to (int)1 from (bool)1,
 thanks to fengguang.wu@intel.com]
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/vmx.c