summaryrefslogtreecommitdiffstats
path: root/arch/mips/kvm
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2021-03-31 09:40:39 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2021-04-17 14:31:05 +0200
commitfe9a5b055116dff7fcee081abc2def4b14d24c21 (patch)
treeb7be7a8169a31747efccfda1c93819e77e411f58 /arch/mips/kvm
parentKVM: MIPS: let generic code call prepare_flush_shadow (diff)
downloadlinux-fe9a5b055116dff7fcee081abc2def4b14d24c21.tar.xz
linux-fe9a5b055116dff7fcee081abc2def4b14d24c21.zip
KVM: MIPS: defer flush to generic MMU notifier code
Return 1 from kvm_unmap_hva_range and kvm_set_spte_hva if a flush is needed, so that the generic code can coalesce the flushes. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/mips/kvm')
-rw-r--r--arch/mips/kvm/mmu.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/arch/mips/kvm/mmu.c b/arch/mips/kvm/mmu.c
index 2cedf908d744..a3a49b009dc4 100644
--- a/arch/mips/kvm/mmu.c
+++ b/arch/mips/kvm/mmu.c
@@ -489,9 +489,7 @@ static int kvm_unmap_hva_handler(struct kvm *kvm, gfn_t gfn, gfn_t gfn_end,
int kvm_unmap_hva_range(struct kvm *kvm, unsigned long start, unsigned long end,
unsigned flags)
{
- handle_hva_to_gpa(kvm, start, end, &kvm_unmap_hva_handler, NULL);
- kvm_flush_remote_tlbs(kvm);
- return 0;
+ return handle_hva_to_gpa(kvm, start, end, &kvm_unmap_hva_handler, NULL);
}
static int kvm_set_spte_handler(struct kvm *kvm, gfn_t gfn, gfn_t gfn_end,
@@ -528,12 +526,7 @@ static int kvm_set_spte_handler(struct kvm *kvm, gfn_t gfn, gfn_t gfn_end,
int kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte)
{
unsigned long end = hva + PAGE_SIZE;
- int ret;
-
- ret = handle_hva_to_gpa(kvm, hva, end, &kvm_set_spte_handler, &pte);
- if (ret)
- kvm_flush_remote_tlbs(kvm);
- return 0;
+ return handle_hva_to_gpa(kvm, hva, end, &kvm_set_spte_handler, &pte);
}
static int kvm_age_hva_handler(struct kvm *kvm, gfn_t gfn, gfn_t gfn_end,