]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: SVM: always update CR3 in VMCB
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 20 May 2020 12:37:37 +0000 (08:37 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 28 May 2020 15:46:18 +0000 (11:46 -0400)
commita8a2439757b3d7a09bd8e428d3b15fbebc116021
treefcf89db625619cb24397a1c496fe6f5c41fc5167
parent7c0fb12236a96abaaa6c2fc2f5f94fa54aa62eab
KVM: SVM: always update CR3 in VMCB

svm_load_mmu_pgd is delaying the write of GUEST_CR3 to prepare_vmcs02 as
an optimization, but this is only correct before the nested vmentry.
If userspace is modifying CR3 with KVM_SET_SREGS after the VM has
already been put in guest mode, the value of CR3 will not be updated.
Remove the optimization, which almost never triggers anyway.
This was was added in commit 05d00e63579a ("KVM: x86: unify callbacks
to load paging root", 2020-03-16) just to keep the two vendor-specific
modules closer, but we'll fix VMX too.

Fixes: 05d00e63579a ("KVM: x86: unify callbacks to load paging root")
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/nested.c
arch/x86/kvm/svm/svm.c