Remove the wbinvd_on_all_cpus inside sev_mem_enc_unregister_region() and sev_vm_destroy() because kvm mmu notifier invalidation event would flush the cache. Signed-off-by: Jacky Li <jackyli@xxxxxxxxxx> Signed-off-by: Mingwei Zhang <mizhang@xxxxxxxxxx> Suggested-by: Sean Christpherson <seanjc@xxxxxxxxxx> --- arch/x86/kvm/svm/sev.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c index 4900c078045a..7fbcb7dea2c0 100644 --- a/arch/x86/kvm/svm/sev.c +++ b/arch/x86/kvm/svm/sev.c @@ -2043,13 +2043,6 @@ int sev_mem_enc_unregister_region(struct kvm *kvm, goto failed; } - /* - * 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(); - __unregister_enc_region_locked(kvm, region); mutex_unlock(&kvm->lock); @@ -2147,13 +2140,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 * then lets unpin all the registered memory. -- 2.43.0.rc0.421.g78406f8d94-goog