• Sean Christopherson's avatar
    KVM: x86/mmu: Commit zap of remaining invalid pages when recovering lpages · e8950569
    Sean Christopherson authored
    Call kvm_mmu_commit_zap_page() after exiting the "prepare zap" loop in
    kvm_recover_nx_lpages() to finish zapping pages in the unlikely event
    that the loop exited due to lpage_disallowed_mmu_pages being empty.
    Because the recovery thread drops mmu_lock() when rescheduling, it's
    possible that lpage_disallowed_mmu_pages could be emptied by a different
    thread without to_zap reaching zero despite to_zap being derived from
    the number of disallowed lpages.
    
    Fixes: 1aa9b957 ("kvm: x86: mmu: Recovery of shattered NX large pages")
    Cc: Junaid Shahid <junaids@google.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
    Message-Id: <20200923183735.584-2-sean.j.christopherson@intel.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    e8950569
mmu.c 171 KB