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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <0cfb1f41-381f-6621-0fe7-14a54059a90d@redhat.com>
Date:   Fri, 29 Apr 2022 10:48:26 +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/29/22 03:03, Hillf Danton wrote:
> Wonder if local lock classes [1] help.
> 
> [1]https://lore.kernel.org/lkml/165055518776.3745911.9346998911322224736.stgit@dwillia2-desk3.amr.corp.intel.com/

No, they wouldn't.  Local lock classes are more of a per-subsystem lock, 
while here the issue is that we are taking an arbitrary amount of locks 
at the same time.

Technically it would be possible to put a struct lock_class_key in 
struct kvm_vcpu, but that wouldn't scale and would actually _reduce_ the 
likelihood of lockdep reporting bad things.

The effectiveness of lockdep comes exactly from using the same map for 
all locks in the class, so that AB/BA scenarios are caught throughout 
the whole life of the system.  If each lock has a separate they would be 
caught only if the "B" is exactly the same mutex in both AB and BA cases.

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ