OSDN Git Service

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 5a046f9..fd61d71 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;
 }