]> git.karo-electronics.de Git - karo-tx-linux.git/commit
KVM: VMX: Fix host userspace gsbase corruption
authorMarcelo Tosatti <mtosatti@redhat.com>
Thu, 31 Mar 2011 18:58:56 +0000 (11:58 -0700)
committerAK <andi@firstfloor.org>
Thu, 31 Mar 2011 18:58:56 +0000 (11:58 -0700)
commitc8149a61de28892d8d28fd2180d1f9bbba2c9551
tree21936b94612c21c0a2bb62c7842bac2c1e880620
parent8aeabadb7ba1c1310bb968950e5f3f1793a58b19
KVM: VMX: Fix host userspace gsbase corruption

commit c8770e7ba63bb5dd8fe5f9d251275a8fa717fb78 upstream.

We now use load_gs_index() to load gs safely; unfortunately this also
changes MSR_KERNEL_GS_BASE, which we managed separately.  This resulted
in confusion and breakage running 32-bit host userspace on a 64-bit kernel.

Fix by
- saving guest MSR_KERNEL_GS_BASE before we we reload the host's gs
- doing the host save/load unconditionally, instead of only when in guest
  long mode

Things can be cleaned up further, but this is the minmal fix for now.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
arch/x86/kvm/vmx.c