mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Mingwei Zhang <mizhang@google.com>,
	Sean Christopherson <seanjc@google.com>
Subject: [PATCH] KVM: Fix build error on s390 due to kvm_flush_shadow_all() being hidden
Date: Thu, 21 Apr 2022 19:26:45 +0000	[thread overview]
Message-ID: <20220421192645.3762857-1-seanjc@google.com> (raw)

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@vger.kernel.org
Cc: Mingwei Zhang <mizhang@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
 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
-- 
2.36.0.rc2.479.g8af0fa9b8e-goog


             reply	other threads:[~2022-04-21 19:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 19:26 Sean Christopherson [this message]
2022-04-21 19:43 ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220421192645.3762857-1-seanjc@google.com \
    --to=seanjc@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mizhang@google.com \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®