]> git.baikalelectronics.ru Git - kernel.git/commit
kvm: x86: fix RSM when PCID is non-zero
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 20 Dec 2017 23:49:14 +0000 (00:49 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 21 Dec 2017 11:59:54 +0000 (12:59 +0100)
commitb81b89aee9b90dbb795bce061c5b063201b6c89b
tree19939a12170be0445651ab50b5b65af6970732d2
parentcdde6d1c9deee77d30f760929c52e34b7534ff08
kvm: x86: fix RSM when PCID is non-zero

rsm_load_state_64() and rsm_enter_protected_mode() load CR3, then
CR4 & ~PCIDE, then CR0, then CR4.

However, setting CR4.PCIDE fails if CR3[11:0] != 0.  It's probably easier
in the long run to replace rsm_enter_protected_mode() with an emulator
callback that sets all the special registers (like KVM_SET_SREGS would
do).  For now, set the PCID field of CR3 only after CR4.PCIDE is 1.

Reported-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Fixes: 2b1d512e33b979572c3063967adc7b424e6c42a3
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/emulate.c