KVM: delete .change_pte MMU notifier callback
The .change_pte() MMU notifier callback was intended as an optimization. The original point of it was that KSM could tell KVM to flip its secondary PTE to a new location without having to first zap it. At the time there was also an .invalidate_page() callback; both of them were *not* bracketed by calls to mmu_notifier_invalidate_range_{start,end}(), and .invalidate_page() also doubled as a fallback implementation of .change_pte(). Later on, however, both callbacks were changed to occur within an invalidate_range_start/end() block. In the case of .change_pte(), commit 6bdb913f ("mm: wrap calls to set_pte_at_notify with invalidate_range_start and invalidate_range_end", 2012-10-09) did so to remove the fallback from .invalidate_page() to .change_pte() and allow sleepable .invalidate_page() hooks. This however made KVM's usage of the .change_pte() callback completely moot, because KVM unmaps the sPTEs during .invalidate_range_start() and therefore .change_pte() has no hope of finding a sPTE to change. Drop the generic KVM code that dispatches to kvm_set_spte_gfn(), as well as all the architecture specific implementations. Signed-off-by:Paolo Bonzini <pbonzini@redhat.com> Acked-by:
Anup Patel <anup@brainfault.org> Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc) Reviewed-by:
Bibo Mao <maobibo@loongson.cn> Message-ID: <20240405115815.3226315-2-pbonzini@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
Showing
- arch/arm64/kvm/mmu.c 0 additions, 34 deletionsarch/arm64/kvm/mmu.c
- arch/loongarch/include/asm/kvm_host.h 0 additions, 1 deletionarch/loongarch/include/asm/kvm_host.h
- arch/loongarch/kvm/mmu.c 0 additions, 32 deletionsarch/loongarch/kvm/mmu.c
- arch/mips/kvm/mmu.c 0 additions, 30 deletionsarch/mips/kvm/mmu.c
- arch/powerpc/include/asm/kvm_ppc.h 0 additions, 1 deletionarch/powerpc/include/asm/kvm_ppc.h
- arch/powerpc/kvm/book3s.c 0 additions, 5 deletionsarch/powerpc/kvm/book3s.c
- arch/powerpc/kvm/book3s.h 0 additions, 1 deletionarch/powerpc/kvm/book3s.h
- arch/powerpc/kvm/book3s_64_mmu_hv.c 0 additions, 12 deletionsarch/powerpc/kvm/book3s_64_mmu_hv.c
- arch/powerpc/kvm/book3s_hv.c 0 additions, 1 deletionarch/powerpc/kvm/book3s_hv.c
- arch/powerpc/kvm/book3s_pr.c 0 additions, 7 deletionsarch/powerpc/kvm/book3s_pr.c
- arch/powerpc/kvm/e500_mmu_host.c 0 additions, 6 deletionsarch/powerpc/kvm/e500_mmu_host.c
- arch/riscv/kvm/mmu.c 0 additions, 20 deletionsarch/riscv/kvm/mmu.c
- arch/x86/kvm/mmu/mmu.c 7 additions, 60 deletionsarch/x86/kvm/mmu/mmu.c
- arch/x86/kvm/mmu/spte.c 0 additions, 16 deletionsarch/x86/kvm/mmu/spte.c
- arch/x86/kvm/mmu/spte.h 0 additions, 2 deletionsarch/x86/kvm/mmu/spte.h
- arch/x86/kvm/mmu/tdp_mmu.c 0 additions, 46 deletionsarch/x86/kvm/mmu/tdp_mmu.c
- arch/x86/kvm/mmu/tdp_mmu.h 0 additions, 1 deletionarch/x86/kvm/mmu/tdp_mmu.h
- include/linux/kvm_host.h 0 additions, 2 deletionsinclude/linux/kvm_host.h
- include/trace/events/kvm.h 0 additions, 15 deletionsinclude/trace/events/kvm.h
- virt/kvm/kvm_main.c 0 additions, 43 deletionsvirt/kvm/kvm_main.c
Please register or sign in to comment