linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: Fix build error on s390 due to kvm_flush_shadow_all() being hidden
@ 2022-04-21 19:26 Sean Christopherson
  2022-04-21 19:43 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Sean Christopherson @ 2022-04-21 19:26 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: kvm, linux-kernel, Mingwei Zhang, Sean Christopherson

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] KVM: Fix build error on s390 due to kvm_flush_shadow_all() being hidden
  2022-04-21 19:26 [PATCH] KVM: Fix build error on s390 due to kvm_flush_shadow_all() being hidden Sean Christopherson
@ 2022-04-21 19:43 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2022-04-21 19:43 UTC (permalink / raw)
  To: Sean Christopherson; +Cc: kvm, linux-kernel, Mingwei Zhang

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@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

Thanks, I'll squash this.

Paolo


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-21 19:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-21 19:26 [PATCH] KVM: Fix build error on s390 due to kvm_flush_shadow_all() being hidden Sean Christopherson
2022-04-21 19:43 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).