• Sean Christopherson's avatar
    KVM: x86/mmu: Pass address space ID to __kvm_tdp_mmu_zap_gfn_range() · 2b9663d8
    Sean Christopherson authored
    Pass the address space ID to TDP MMU's primary "zap gfn range" helper to
    allow the MMU notifier paths to iterate over memslots exactly once.
    Currently, both the legacy MMU and TDP MMU iterate over memslots when
    looking for an overlapping hva range, which can be quite costly if there
    are a large number of memslots.
    
    Add a "flush" parameter so that iterating over multiple address spaces
    in the caller will continue to do the right thing when yielding while a
    flush is pending from a previous address space.
    
    Note, this also has a functional change in the form of coalescing TLB
    flushes across multiple address spaces in kvm_zap_gfn_range(), and also
    optimizes the TDP MMU to utilize range-based flushing when running as L1
    with Hyper-V enlightenments.
    Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
    Message-Id: <20210326021957.1424875-6-seanjc@google.com>
    [Keep separate for loops to prepare for other incoming patches. - Paolo]
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    2b9663d8
mmu.c 158 KB