KVM: nVMX: load GUEST_EFER after GUEST_CR0 during emulated VM-entry
authorDavid Matlack <dmatlack@google.com>
Wed, 30 Nov 2016 02:14:10 +0000 (18:14 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 8 Dec 2016 14:31:08 +0000 (15:31 +0100)
commit5a6a9748b4b41c1708dca12342256a19434513f2
tree1c34c6ca242bc39e266971041d91425bdcc71b18
parent8322ebbb24088c22049ef53cd066c6c220640edb
KVM: nVMX: load GUEST_EFER after GUEST_CR0 during emulated VM-entry

vmx_set_cr0() modifies GUEST_EFER and "IA-32e mode guest" in the current
VMCS. Call vmx_set_efer() after vmx_set_cr0() so that emulated VM-entry
is more faithful to VMCS12.

This patch correctly causes VM-entry to fail when "IA-32e mode guest" is
1 and GUEST_CR0.PG is 0. Previously this configuration would succeed and
"IA-32e mode guest" would silently be disabled by KVM.

Signed-off-by: David Matlack <dmatlack@google.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/vmx.c