Skip to content

Commit 10a3792

Browse files
committed
KVM: SEV: do not take kvm->lock when destroying
Taking the lock is useless since there are no other references, and there are already accesses (e.g. to sev->enc_context_owner) that do not take it. So get rid of it. Reviewed-by: Sean Christopherson <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 17d44a9 commit 10a3792

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

arch/x86/kvm/svm/sev.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2048,8 +2048,6 @@ void sev_vm_destroy(struct kvm *kvm)
20482048
return;
20492049
}
20502050

2051-
mutex_lock(&kvm->lock);
2052-
20532051
/*
20542052
* Ensure that all guest tagged cache entries are flushed before
20552053
* releasing the pages back to the system for use. CLFLUSH will
@@ -2069,8 +2067,6 @@ void sev_vm_destroy(struct kvm *kvm)
20692067
}
20702068
}
20712069

2072-
mutex_unlock(&kvm->lock);
2073-
20742070
sev_unbind_asid(kvm, sev->handle);
20752071
sev_asid_free(sev);
20762072
}

0 commit comments

Comments
 (0)