On 4/21/22 21:26, Sean Christopherson wrote:
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
Fixes: b56a4ff6bff3 ("KVM: SEV: add cache flush to solve SEV cache incoherency issues")
Cc: stable@xxxxxxxxxxxxxxx
Cc: Mingwei Zhang <mizhang@xxxxxxxxxx>
Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
---
virt/kvm/kvm_main.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index a719e52f3eb7..f30bb8c16f26 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -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
Thanks, I'll squash this.
Paolo