KVM: Remove unnecessary export of kvm_{inc,dec}_notifier_count()
Sean Christopherson
reviewerPATCH 1/1 KVM: Remove unnecessary export of kvm_{inc,dec}_notifier_count()
Don't export KVM's MMU notifier count helpers, under no circumstance should any downstream module, including x86's vendor code, have a legitimate reason to piggyback KVM's MMU notifier logic. E.g in the x86 case, only KVM's MMU should be elevating the notifier count, and that code is always built into the core kvm.ko module.
--- virt/kvm/kvm_main.c | 3 --- 1 file changed, 3 deletions(-)
virt/kvm/kvm_main.c +0 -3
@@ -638,7 +638,6 @@ void kvm_inc_notifier_count(struct kvm *kvm, unsigned long start,max (kvm->mmu_notifier_range_end, end); } } -EXPORT_SYMBOL_GPL (kvm_inc_notifier_count);static int kvm_mmu_notifier_invalidate_range_start (struct mmu_notifier *mn,const struct mmu_notifier_range *range)
@@ -690,8 +689,6 @@ void kvm_dec_notifier_count(struct kvm *kvm, unsigned long start,*/ kvm->mmu_notifier_count--; } -EXPORT_SYMBOL_GPL (kvm_dec_notifier_count); -static void kvm_mmu_notifier_invalidate_range_end (struct mmu_notifier *mn,const struct mmu_notifier_range *range)
Signature · 1 line
2.33.0.153.gba50c8fa24-goog
Quoted 26 lines · Sean Christopherson
Don't export KVM's MMU notifier count helpers, under no circumstance should any downstream module, including x86's vendor code, have a legitimate reason to piggyback KVM's MMU notifier logic. E.g in the x86 case, only KVM's MMU should be elevating the notifier count, and that code is always built into the core kvm.ko module.
Fixes edb298c663fc ("KVM: x86/mmu: bump mmu notifier count in kvm_zap_gfn_range")Cc Maxim Levitsky <[email protected]>Signed-off-by Sean Christopherson <[email protected]>--- virt/kvm/kvm_main.c | 3 --- 1 file changed, 3 deletions(-)virt/kvm/kvm_main.c +0
-1@@ -638,7 +638,6 @@ void kvm_inc_notifier_count(struct kvm *kvm, unsigned long start,max (kvm->mmu_notifier_range_end, end); } } -EXPORT_SYMBOL_GPL (kvm_inc_notifier_count);static int kvm_mmu_notifier_invalidate_range_start (struct mmu_notifier *mn,const struct mmu_notifier_range *range)
virt/kvm/kvm_main.c void kvm_dec_notifier_count(struct kvm *kvm, unsigned long start, · line 694
Quoted 8 lines
virt/kvm/kvm_main.c +0
-2@@ -690,8 +689,6 @@ void kvm_dec_notifier_count(struct kvm *kvm, unsigned long start,*/ kvm->mmu_notifier_count--; } -EXPORT_SYMBOL_GPL (kvm_dec_notifier_count); -static void kvm_mmu_notifier_invalidate_range_end (struct mmu_notifier *mn,const struct mmu_notifier_range *range)
Ah, I somehow thought when I wrote this that those two will be used by kvm_amd.
Best regards,
Maxim Levitsky
Quoted 38 lines · Maxim Levitsky
Quoted 26 lines · Sean Christopherson
Don't export KVM's MMU notifier count helpers, under no circumstance should any downstream module, including x86's vendor code, have a legitimate reason to piggyback KVM's MMU notifier logic. E.g in the x86 case, only KVM's MMU should be elevating the notifier count, and that code is always built into the core kvm.ko module.
Fixes edb298c663fc ("KVM: x86/mmu: bump mmu notifier count in kvm_zap_gfn_range")Cc Maxim Levitsky <[email protected]>Signed-off-by Sean Christopherson <[email protected]>--- virt/kvm/kvm_main.c | 3 --- 1 file changed, 3 deletions(-)virt/kvm/kvm_main.c +0
-1@@ -638,7 +638,6 @@ void kvm_inc_notifier_count(struct kvm *kvm, unsigned long start,max (kvm->mmu_notifier_range_end, end); } } -EXPORT_SYMBOL_GPL (kvm_inc_notifier_count);static int kvm_mmu_notifier_invalidate_range_start (struct mmu_notifier *mn,const struct mmu_notifier_range *range)virt/kvm/kvm_main.c void kvm_dec_notifier_count(struct kvm *kvm, unsigned long start, · line 694
Quoted 8 lines
virt/kvm/kvm_main.c +0
-2@@ -690,8 +689,6 @@ void kvm_dec_notifier_count(struct kvm *kvm, unsigned long start,*/ kvm->mmu_notifier_count--; } -EXPORT_SYMBOL_GPL (kvm_dec_notifier_count); -static void kvm_mmu_notifier_invalidate_range_end (struct mmu_notifier *mn,const struct mmu_notifier_range *range)Ah, I somehow thought when I wrote this that those two will be used by
kvm_amd.
Quoted 5 lines
Reviewed-by Maxim Levitsky <[email protected]>Best regards,
Maxim Levitsky
Queued, thanks.
Paolo