On 8/30/25 01:31, Paolo Bonzini wrote:
Make the code common to all accelerators: after seeing cpu->exit_request set to true, accelerator code needs to reach qemu_wait_io_event_common().So for the common cases where they use qemu_wait_io_event(), go ahead and clear it in there. Note that the cheap qatomic_set() is enough because at this point the thread has taken the BQL; qatomic_set_mb() is not needed. In particular, this is the ordering of the communication between I/O and vCPU threads is always the same. In the I/O thread: (a) store other memory locations that will be checked if cpu->exit_request or cpu->interrupt_request is 1 (for example cpu->stop or cpu->work_list for cpu->exit_request) (b) cpu_exit(): store-release cpu->exit_request, or (b) cpu_interrupt(): store-release cpu->interrupt_request
Mm. This is the reason we want the seq_cst of the qatomic_or. Perhaps comments in patch 7 should be expanded to document this? Anyway for this patch, Reviewed-by: Richard Henderson <[email protected]> r~
