]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: skip over invalid root pages when zapping all sptes
authorSean Christopherson <sean.j.christopherson@intel.com>
Tue, 5 Feb 2019 21:01:32 +0000 (13:01 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 20 Feb 2019 21:48:46 +0000 (22:48 +0100)
commitf72c580cbbf325b0c7da07bd7ff72dd0588017ff
tree1e4188486bc028bd6c05afecfe01e7d8548a81b9
parent7550b7a731d48e236b4e8155d5db6bb9bd283527
KVM: x86/mmu: skip over invalid root pages when zapping all sptes

...to guarantee forward progress.  When zapped, root pages are marked
invalid and moved to the head of the active pages list until they are
explicitly freed.  Theoretically, having unzappable root pages at the
head of the list could prevent kvm_mmu_zap_all() from making forward
progress were a future patch to add a loop restart after processing a
page, e.g. to drop mmu_lock on contention.

Although kvm_mmu_prepare_zap_page() can theoretically take action on
invalid pages, e.g. to zap unsync children, functionally it's not
necessary (root pages will be re-zapped when freed) and practically
speaking the odds of e.g. @unsync or @unsync_children becoming %true
while zapping all pages is basically nil.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu.c