On 28 December 2022 11:58:56 GMT, Paolo Bonzini <pbonzini@xxxxxxxxxx> wrote: >On 12/28/22 10:54, David Woodhouse wrote: >>> Yes, I imagine that in practice you won't have running vCPUs during a >>> reset but the bug exists. Thanks! >> If it's just kvm_xen_evtchn_reset() I can fix that — and have to >> anyway, even if we switch the Xen code to its own lock. >> >> But what is the general case lock ordering rule here? Can other code >> call synchronize_srcu() while holding kvm->lock? Or is that verboten? > >Nope, it's a general rule---and one that would extend to any other lock taken inside srcu_read_lock(&kvm->srcu). > >I have sent a patch to fix reset, and one to clarify the lock ordering rules. Can we teach lockdep too?