]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: SVM: Remove wbinvd in sev_vm_destroy()
authorZheyun Shen <szy0127@sjtu.edu.cn>
Thu, 22 May 2025 23:37:30 +0000 (16:37 -0700)
committerSean Christopherson <seanjc@google.com>
Thu, 10 Jul 2025 16:43:43 +0000 (09:43 -0700)
Before sev_vm_destroy() is called, kvm_arch_guest_memory_reclaimed()
has been called for SEV and SEV-ES and kvm_arch_gmem_invalidate()
has been called for SEV-SNP. These functions have already handled
flushing the memory. Therefore, this wbinvd_on_all_cpus() can
simply be dropped.

Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Zheyun Shen <szy0127@sjtu.edu.cn>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://lore.kernel.org/r/20250522233733.3176144-7-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/sev.c

index 459c3b791fd4325a9ac7a22efee8e90f495b76ec..e4180b82b375049606a0c19c47fe933b7662fce3 100644 (file)
@@ -2820,12 +2820,6 @@ void sev_vm_destroy(struct kvm *kvm)
                return;
        }
 
-       /*
-        * Ensure that all guest tagged cache entries are flushed before
-        * releasing the pages back to the system for use. CLFLUSH will
-        * not do this, so issue a WBINVD.
-        */
-       wbinvd_on_all_cpus();
 
        /*
         * if userspace was terminated before unregistering the memory regions