Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: Move prototypes for MMU notifier callbacks to generic code

Move the prototypes for the MMU notifier callbacks out of arch code and
into common code. There is no benefit to having each arch replicate the
prototypes since any deviation from the invocation in common code will
explode.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210326021957.1424875-9-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

authored by

Sean Christopherson and committed by
Paolo Bonzini
5f7c292b aaaac889

+9 -22
-5
arch/arm64/include/asm/kvm_host.h
··· 582 582 struct kvm_vcpu_events *events); 583 583 584 584 #define KVM_ARCH_WANT_MMU_NOTIFIER 585 - int kvm_unmap_hva_range(struct kvm *kvm, 586 - unsigned long start, unsigned long end, unsigned flags); 587 - int kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte); 588 - int kvm_age_hva(struct kvm *kvm, unsigned long start, unsigned long end); 589 - int kvm_test_age_hva(struct kvm *kvm, unsigned long hva); 590 585 591 586 void kvm_arm_halt_guest(struct kvm *kvm); 592 587 void kvm_arm_resume_guest(struct kvm *kvm);
-5
arch/mips/include/asm/kvm_host.h
··· 967 967 bool write); 968 968 969 969 #define KVM_ARCH_WANT_MMU_NOTIFIER 970 - int kvm_unmap_hva_range(struct kvm *kvm, 971 - unsigned long start, unsigned long end, unsigned flags); 972 - int kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte); 973 - int kvm_age_hva(struct kvm *kvm, unsigned long start, unsigned long end); 974 - int kvm_test_age_hva(struct kvm *kvm, unsigned long hva); 975 970 976 971 /* Emulation */ 977 972 int kvm_get_inst(u32 *opc, struct kvm_vcpu *vcpu, u32 *out);
-7
arch/powerpc/include/asm/kvm_host.h
··· 56 56 57 57 #define KVM_ARCH_WANT_MMU_NOTIFIER 58 58 59 - extern int kvm_unmap_hva_range(struct kvm *kvm, 60 - unsigned long start, unsigned long end, 61 - unsigned flags); 62 - extern int kvm_age_hva(struct kvm *kvm, unsigned long start, unsigned long end); 63 - extern int kvm_test_age_hva(struct kvm *kvm, unsigned long hva); 64 - extern int kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte); 65 - 66 59 #define HPTEG_CACHE_NUM (1 << 15) 67 60 #define HPTEG_HASH_BITS_PTE 13 68 61 #define HPTEG_HASH_BITS_PTE_LONG 12
+1 -5
arch/x86/include/asm/kvm_host.h
··· 1718 1718 _ASM_EXTABLE(666b, 667b) 1719 1719 1720 1720 #define KVM_ARCH_WANT_MMU_NOTIFIER 1721 - int kvm_unmap_hva_range(struct kvm *kvm, unsigned long start, unsigned long end, 1722 - unsigned flags); 1723 - int kvm_age_hva(struct kvm *kvm, unsigned long start, unsigned long end); 1724 - int kvm_test_age_hva(struct kvm *kvm, unsigned long hva); 1725 - int kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte); 1721 + 1726 1722 int kvm_cpu_has_injectable_intr(struct kvm_vcpu *v); 1727 1723 int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu); 1728 1724 int kvm_cpu_has_extint(struct kvm_vcpu *v);
+8
include/linux/kvm_host.h
··· 218 218 int kvm_async_pf_wakeup_all(struct kvm_vcpu *vcpu); 219 219 #endif 220 220 221 + #ifdef KVM_ARCH_WANT_MMU_NOTIFIER 222 + int kvm_unmap_hva_range(struct kvm *kvm, 223 + unsigned long start, unsigned long end, unsigned flags); 224 + int kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte); 225 + int kvm_age_hva(struct kvm *kvm, unsigned long start, unsigned long end); 226 + int kvm_test_age_hva(struct kvm *kvm, unsigned long hva); 227 + #endif 228 + 221 229 enum { 222 230 OUTSIDE_GUEST_MODE, 223 231 IN_GUEST_MODE,