Skip to content

Commit

Permalink
KVM: SEV: do not take kvm->lock when destroying
Browse files Browse the repository at this point in the history
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 <seanjc@google.com>
Message-Id: <20211123005036.2954379-12-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Paolo Bonzini committed Nov 30, 2021
1 parent 17d44a9 commit 10a3792
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions arch/x86/kvm/svm/sev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2048,8 +2048,6 @@ void sev_vm_destroy(struct kvm *kvm)
return;
}

mutex_lock(&kvm->lock);

/*
* Ensure that all guest tagged cache entries are flushed before
* releasing the pages back to the system for use. CLFLUSH will
Expand All @@ -2069,8 +2067,6 @@ void sev_vm_destroy(struct kvm *kvm)
}
}

mutex_unlock(&kvm->lock);

sev_unbind_asid(kvm, sev->handle);
sev_asid_free(sev);
}
Expand Down

0 comments on commit 10a3792

Please sign in to comment.