lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <327afdf9-357f-71c7-fd45-56aa41aeb134@redhat.com>
Date:   Sat, 30 Apr 2022 10:11:53 +0200
From:   Paolo Bonzini <pbonzini@...hat.com>
To:     Hillf Danton <hdanton@...a.com>
Cc:     Peter Gonda <pgonda@...gle.com>,
        Sean Christopherson <seanjc@...gle.com>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3] KVM: SEV: Mark nested locking of vcpu->lock

On 4/30/22 03:50, Hillf Danton wrote:
> 	lock for migration
> 	===
> 	kvm_for_each_vcpu(i, vcpu, kvm) {
> 		if (mutex_lock_killable(&vcpu->mutex))
> 			goto out_unlock;
> 		lockdep_copy_map(&vcpu->v_dep_map, &vcpu->mutex.dep_map);
> 		mutex_release(&vcpu->mutex.dep_map, ip);
> 	}
> 
> 
> 	unlock for migration
> 	===
> 	kvm_for_each_vcpu(i, vcpu, kvm) {
> 		lockdep_copy_map(&vcpu->mutex.dep_map, &vcpu->v_dep_map);
> 		/*
> 		 * Or directly acquire without v_dep_map added
> 		 *
> 		mutex_acquire(&vcpu->mutex.dep_map, 0, 1,_RET_IP_);
> 		 */
> 		mutex_unlock(&vcpu->mutex);
> 	}

Yes this is exactly what Peter is doing, except that we're trying to 
keep one lock taken.  Thanks for pointing to lock_sock_nested().

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ