]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: MMU: load PDPTRs outside mmu_lock
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 8 Apr 2021 12:10:25 +0000 (08:10 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 17 Apr 2021 12:30:52 +0000 (08:30 -0400)
commit4a08175351a50e0b891fa8a039c14f11327aebb7
treecc03d02c0620fc31aff035d188c891e7175b98b2
parent30d88bb224d01e39971925ab6258562f0f7aa6e8
KVM: MMU: load PDPTRs outside mmu_lock

On SVM, reading PDPTRs might access guest memory, which might fault
and thus might sleep.  On the other hand, it is not possible to
release the lock after make_mmu_pages_available has been called.

Therefore, push the call to make_mmu_pages_available and the
mmu_lock critical section within mmu_alloc_direct_roots and
mmu_alloc_shadow_roots.

Reported-by: Wanpeng Li <wanpengli@tencent.com>
Co-developed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c