]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: x86: fix RSM into 64-bit protected mode
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 14 Oct 2015 13:25:52 +0000 (15:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Oct 2015 00:53:40 +0000 (09:53 +0900)
commit03900dd5e4e08e3617d82c8b62bf5ed48d2508cd
tree738175360701e9164ae3b77ec1277a106a2fc9fc
parent0c2d5845347acbb2c140bd3e75baa8cd4a368949
KVM: x86: fix RSM into 64-bit protected mode

commit b10d92a54dac25a6152f1aa1ffc95c12908035ce upstream.

In order to get into 64-bit protected mode, you need to enable
paging while EFER.LMA=1.  For this to work, CS.L must be 0.
Currently, we load the segments before CR0 and CR4, which means
that if RSM returns into 64-bit protected mode CS.L is already 1
and everything breaks.

Luckily, CS.L=0 is always the case when executing RSM, because it
is forbidden to execute RSM from 64-bit protected mode.  Hence it
is enough to load CR0 and CR4 first, and only then the segments.

Fixes: 660a5d517aaab9187f93854425c4c63f4a09195c
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/emulate.c