KVM: VMX: Update necessary state when guest enters long mode
authorAmit Shah <amit.shah@redhat.com>
Fri, 20 Feb 2009 17:23:37 +0000 (22:53 +0530)
committerAvi Kivity <avi@redhat.com>
Tue, 24 Mar 2009 09:03:13 +0000 (11:03 +0200)
commit401d10dee083bda281f2fdcdf654080313ba30ec
treec70fc703853ae2f14c8f6e1c79d17f41ed1ab90f
parent6b08035f3e64d8e474be166d682b52c95941662e
KVM: VMX: Update necessary state when guest enters long mode

setup_msrs() should be called when entering long mode to save the
shadow state for the 64-bit guest state.

Using vmx_set_efer() in enter_lmode() removes some duplicated code
and also ensures we call setup_msrs(). We can safely pass the value
of shadow_efer to vmx_set_efer() as no other bits in the efer change
while enabling long mode (guest first sets EFER.LME, then sets CR0.PG
which causes a vmexit where we activate long mode).

With this fix, is_long_mode() can check for EFER.LMA set instead of
EFER.LME and 5e23049e86dd298b72e206b420513dbc3a240cd9 can be reverted.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/vmx.c