On Tue, 8 Sept 2026 at 10:29, Paolo Bonzini <[email protected]> wrote: > > On Tue, Sep 8, 2026 at 10:40 AM Peter Maydell <[email protected]> > wrote: > > Ah, so it is called without the BQL held? That's quite unusual > > for CPU methods, so we should clearly document that. > > I agree. > > > I bet also that most targets don't expect it. Picking one at > > random, the sparc has_work function calls e.g. cpu_interrupts_enabled() > > which does not look like a function that is expecting to be called > > without the BQL. > > Why? It only accesses fields for the local CPU. The problem is > interprocedural communication, and only if it does not use > cpu_interrupt().
Mmm, I guess this is OK: actual TCG code execution also accesses local CPU fields with the BQL not held, and if we're definitely always on the local vcpu thread when we call has_work then this is more or less the same thing. Doing anything more complicated than "we hold a lock" for thread-safety makes me nervous, is all :-) -- PMM
