]> git.karo-electronics.de Git - karo-tx-linux.git/commit
KVM: VMX: Fix delayed load of shared MSRs
authorAvi Kivity <avi@redhat.com>
Wed, 9 May 2012 13:10:43 +0000 (16:10 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 May 2012 16:32:20 +0000 (09:32 -0700)
commit044873c9fc637a88225f0e01bedb9daee04524ed
tree86d3238d84d3d0075ada38eba26d49b8cb2803df
parent9c895160d25a76c21b65bad141b08e8d4f99afef
KVM: VMX: Fix delayed load of shared MSRs

(cherry picked from commit 9ee73970c03edb68146ceb1ba2a7033c99a5e017)

Shared MSRs (MSR_*STAR and related) are stored in both vmx->guest_msrs
and in the CPU registers, but vmx_set_msr() only updated memory. Prior
to 46199f33c2953, this didn't matter, since we called vmx_load_host_state(),
which scheduled a vmx_save_host_state(), which re-synchronized the CPU
state, but now we don't, so the CPU state will not be synchronized until
the next exit to host userspace.  This mostly affects nested vmx workloads,
which play with these MSRs a lot.

Fix by loading the MSR eagerly.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/vmx.c