KVM/MMU: Flush tlb directly in kvm_set_pte_rmapp()
authorLan Tianyu <Tianyu.Lan@microsoft.com>
Thu, 6 Dec 2018 13:21:12 +0000 (21:21 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 21 Dec 2018 10:28:42 +0000 (11:28 +0100)
This patch is to flush tlb directly in kvm_set_pte_rmapp()
function when Hyper-V remote TLB flush is available, returning 0
so that kvm_mmu_notifier_change_pte() does not flush again.

Signed-off-by: Lan Tianyu <Tianyu.Lan@microsoft.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu.c

index 5a046f93a41a74dfad6927698b74b9b99e671961..fd61d715ebd6fd8c0f0e18ac4b422a769dabd69f 100644 (file)
@@ -1776,6 +1776,11 @@ restart:
                }
        }
 
+       if (need_flush && kvm_available_flush_tlb_with_range()) {
+               kvm_flush_remote_tlbs_with_address(kvm, gfn, 1);
+               return 0;
+       }
+
        return need_flush;
 }