summaryrefslogtreecommitdiff
path: root/arch/mips/kvm/mmu.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2021-03-31 09:38:16 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2021-04-17 08:31:05 -0400
commit5194552fb1ffb4248c8db3f7286aa4ac7ae3163b (patch)
tree47fc24a1b763ab2b83a0f0e10b1ac1b2ade30025 /arch/mips/kvm/mmu.c
parent6c9dd6d26216ad9733e57f382e1669c142494aab (diff)
KVM: MIPS: rework flush_shadow_* callbacks into one that prepares the flush
Both trap-and-emulate and VZ have a single implementation that covers both .flush_shadow_all and .flush_shadow_memslot, and both of them end with a call to kvm_flush_remote_tlbs. Unify the callbacks into one and extract the call to kvm_flush_remote_tlbs. The next patches will pull it further out of the the architecture-specific MMU notifier functions kvm_unmap_hva_range and kvm_set_spte_hva. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/mips/kvm/mmu.c')
-rw-r--r--arch/mips/kvm/mmu.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/mips/kvm/mmu.c b/arch/mips/kvm/mmu.c
index 3dabeda82458..7e055e5dfd3c 100644
--- a/arch/mips/kvm/mmu.c
+++ b/arch/mips/kvm/mmu.c
@@ -491,7 +491,8 @@ int kvm_unmap_hva_range(struct kvm *kvm, unsigned long start, unsigned long end,
{
handle_hva_to_gpa(kvm, start, end, &kvm_unmap_hva_handler, NULL);
- kvm_mips_callbacks->flush_shadow_all(kvm);
+ kvm_mips_callbacks->prepare_flush_shadow(kvm);
+ kvm_flush_remote_tlbs(kvm);
return 0;
}
@@ -532,8 +533,10 @@ int kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte)
int ret;
ret = handle_hva_to_gpa(kvm, hva, end, &kvm_set_spte_handler, &pte);
- if (ret)
- kvm_mips_callbacks->flush_shadow_all(kvm);
+ if (ret) {
+ kvm_mips_callbacks->prepare_flush_shadow(kvm);
+ kvm_flush_remote_tlbs(kvm);
+ }
return 0;
}