KVM: Correct ordering of ldt reload wrt fs/gs reload
authorAvi Kivity <avi@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)
commit8aeabadb7ba1c1310bb968950e5f3f1793a58b19
tree8072e439bdfcd284437749ebf608bc5eea8b34c1
parentb59a19a633904c9b1bb7fbbdb33023b1eb7ce641
KVM: Correct ordering of ldt reload wrt fs/gs reload

commit 0a77fe4c188e25917799f2356d4aa5e6d80c39a2 upstream.

If fs or gs refer to the ldt, they must be reloaded after the ldt.  Reorder
the code to that effect.

Userspace code that uses the ldt with kvm is nonexistent, so this doesn't fix
a user-visible bug.

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/svm.c
arch/x86/kvm/vmx.c