From: Lai Jiangshan Date: Sat, 18 Sep 2021 00:56:33 +0000 (+0800) Subject: KVM: X86: Zap the invalid list after remote tlb flushing X-Git-Tag: microblaze-v5.18~629^2~99 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=5591c0694d85b768c28e9d04c0138b8ff202bff6;p=linux-2.6-microblaze.git KVM: X86: Zap the invalid list after remote tlb flushing In mmu_sync_children(), it can zap the invalid list after remote tlb flushing. Emptifying the invalid list ASAP might help reduce a remote tlb flushing in some cases. Signed-off-by: Lai Jiangshan Signed-off-by: Paolo Bonzini Message-Id: <20210918005636.3675-8-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini --- diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index 34de5a8ea7dc..ccfcdc02d214 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -2035,7 +2035,7 @@ static int mmu_sync_children(struct kvm_vcpu *vcpu, protected |= rmap_write_protect(vcpu, sp->gfn); if (protected) { - kvm_flush_remote_tlbs(vcpu->kvm); + kvm_mmu_remote_flush_or_zap(vcpu->kvm, &invalid_list, true); flush = false; }