]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
KVM: VMX: Update necessary state when guest enters long mode
authorAmit Shah <amit.shah@redhat.com>
Fri, 17 Apr 2009 22:40:12 +0000 (19:40 -0300)
committerChris Wright <chrisw@sous-sol.org>
Mon, 27 Apr 2009 17:37:04 +0000 (10:37 -0700)
commit7c3dbe6360ed32c9433524b7744d58ece1b605ad
tree3743e99429c44a241747c42d6d65dd2290ec89fb
parent18020173f9665487de72c53eca76a1689f2afb48
KVM: VMX: Update necessary state when guest enters long mode

upstream commit: 401d10dee083bda281f2fdcdf654080313ba30ec

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>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
arch/x86/kvm/vmx.c