Commit 597cb796 authored by Wanpeng Li's avatar Wanpeng Li Committed by Paolo Bonzini

KVM: SEV: Mark nested locking of kvm->lock

Both source and dest vms' kvm->locks are held in sev_lock_two_vms.
Mark one with a different subtype to avoid false positives from lockdep.

Fixes: c9d61dcb (KVM: SEV: accept signals in sev_lock_two_vms)
Reported-by: default avatarYiru Xu <xyru1999@gmail.com>
Tested-by: default avatarJinrong Liang <cloudliang@tencent.com>
Signed-off-by: default avatarWanpeng Li <wanpengli@tencent.com>
Message-Id: <1641364863-26331-1-git-send-email-wanpengli@tencent.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent fdba608f
...@@ -1565,7 +1565,7 @@ static int sev_lock_two_vms(struct kvm *dst_kvm, struct kvm *src_kvm) ...@@ -1565,7 +1565,7 @@ static int sev_lock_two_vms(struct kvm *dst_kvm, struct kvm *src_kvm)
r = -EINTR; r = -EINTR;
if (mutex_lock_killable(&dst_kvm->lock)) if (mutex_lock_killable(&dst_kvm->lock))
goto release_src; goto release_src;
if (mutex_lock_killable(&src_kvm->lock)) if (mutex_lock_killable_nested(&src_kvm->lock, SINGLE_DEPTH_NESTING))
goto unlock_dst; goto unlock_dst;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment