KVM: Fix build error on s390 due to kvm_flush_shadow_all() being hidden
Sean Christopherson
reviewerPATCH 1/1 KVM: Fix build error on s390 due to kvm_flush_shadow_all() being hidden
Hoist kvm_flush_shadow_all() out of the #ifdef block that depends on the mmu_notifier being enabled and wanted by KVM. KVM s390 doesn't utilize the mmu_notifier, and so the direct call to kvm_flush_shadow_all() in vm_destroy() rightly complains.
virt/kvm/kvm_main.c: In function ‘kvm_destroy_vm’:virt/kvm/kvm_main.c:1248:9: error: implicit declaration of function ‘kvm_flush_shadow_all’; did you mean ‘kvm_arch_flush_shadow_all’? [-Werror=implicit-function-declaration]
1248 | kvm_flush_shadow_all(kvm);
| ^~~~~~~~~~~~~~~~~~~~
| kvm_arch_flush_shadow_all--- virt/kvm/kvm_main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
virt/kvm/kvm_main.c +6 -6
@@ -361,6 +361,12 @@ void kvm_flush_remote_tlbs(struct kvm *kvm)EXPORT_SYMBOL_GPL (kvm_flush_remote_tlbs);#endif +static void kvm_flush_shadow_all (struct kvm *kvm) +{ +kvm_arch_flush_shadow_all (kvm); +kvm_arch_guest_memory_reclaimed (kvm); +} +#ifdef KVM_ARCH_NR_OBJS_PER_MEMORY_CACHE static inline void *mmu_memory_cache_alloc_obj (struct kvm_mmu_memory_cache *mc,gfp_t gfp_flags)
@@ -820,12 +826,6 @@ static int kvm_mmu_notifier_test_young(struct mmu_notifier *mn, kvm_test_age_gfn); } -static void kvm_flush_shadow_all (struct kvm *kvm) -{ -kvm_arch_flush_shadow_all (kvm); -kvm_arch_guest_memory_reclaimed (kvm); -} -static void kvm_mmu_notifier_release (struct mmu_notifier *mn,struct mm_struct *mm) {
base-commit: b56a4ff6bff38fc49d8e583a3fbb5e18d1a99963
Signature · 1 line
2.36.0.rc2.479.g8af0fa9b8e-goog
Paolo Bonzini
maintainerQuoted 51 lines · Sean Christopherson
Hoist
kvm_flush_shadow_all()out of the #ifdef block that depends on themmu_notifierbeing enabled and wanted by KVM. KVM s390 doesn't utilize themmu_notifier, and so the direct call tokvm_flush_shadow_all()invm_destroy()rightly complains.
virt/kvm/kvm_main.c: In function ‘kvm_destroy_vm’:virt/kvm/kvm_main.c:1248:9: error: implicit declaration of function ‘kvm_flush_shadow_all’; did you mean ‘kvm_arch_flush_shadow_all’? [-Werror=implicit-function-declaration]1248 | kvm_flush_shadow_all(kvm); | ^~~~~~~~~~~~~~~~~~~~ | kvm_arch_flush_shadow_allFixes b56a4ff6bff3 ("KVM: SEV: add cache flush to solve SEV cache incoherency issues")Cc Mingwei Zhang <[email protected]>Signed-off-by Sean Christopherson <[email protected]>--- virt/kvm/kvm_main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)virt/kvm/kvm_main.c +6
-6@@ -361,6 +361,12 @@ void kvm_flush_remote_tlbs(struct kvm *kvm)EXPORT_SYMBOL_GPL (kvm_flush_remote_tlbs);#endif +static void kvm_flush_shadow_all (struct kvm *kvm) +{ +kvm_arch_flush_shadow_all (kvm); +kvm_arch_guest_memory_reclaimed (kvm); +} +#ifdef KVM_ARCH_NR_OBJS_PER_MEMORY_CACHE static inline void *mmu_memory_cache_alloc_obj (struct kvm_mmu_memory_cache *mc,gfp_t gfp_flags)@@ -820,12 +826,6 @@ static int kvm_mmu_notifier_test_young(struct mmu_notifier *mn, kvm_test_age_gfn); } -static void kvm_flush_shadow_all (struct kvm *kvm) -{ -kvm_arch_flush_shadow_all (kvm); -kvm_arch_guest_memory_reclaimed (kvm); -} -static void kvm_mmu_notifier_release (struct mmu_notifier *mn,struct mm_struct *mm) {
Quoted 1 line
base-commit:
b56a4ff6bff38fc49d8e583a3fbb5e18d1a99963
Thanks, I'll squash this.
Paolo