lkml.org 
[lkml]   [2022]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    Subject[PATCH v3 18/28] KVM: x86/mmu: Do remote TLB flush before dropping RCU in TDP MMU resched
    From
    When yielding in the TDP MMU iterator, service any pending TLB flush
    before dropping RCU protections in anticipation of using the caller's RCU
    "lock" as a proxy for vCPUs in the guest.

    Signed-off-by: Sean Christopherson <seanjc@google.com>
    Reviewed-by: Ben Gardon <bgardon@google.com>
    ---
    arch/x86/kvm/mmu/tdp_mmu.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c
    index 42803d5dbbf9..ef594af246f5 100644
    --- a/arch/x86/kvm/mmu/tdp_mmu.c
    +++ b/arch/x86/kvm/mmu/tdp_mmu.c
    @@ -730,11 +730,11 @@ static inline bool __must_check tdp_mmu_iter_cond_resched(struct kvm *kvm,
    return false;

    if (need_resched() || rwlock_needbreak(&kvm->mmu_lock)) {
    - rcu_read_unlock();
    -
    if (flush)
    kvm_flush_remote_tlbs(kvm);

    + rcu_read_unlock();
    +
    if (shared)
    cond_resched_rwlock_read(&kvm->mmu_lock);
    else
    --
    2.35.1.574.g5d30c73bfb-goog
    \
     
     \ /
      Last update: 2022-02-26 01:18    [W:4.191 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site