On 13/02/2015 10:37, Mark Burton wrote: > the memory barrier is on the cpu requesting the flush isn’t it (not > on the CPU that is being flushed)?
Oops, I misread Peter's explanation. In that case, perhaps DMB can be treated in a similar way as WFI, using cpu->halted. Queueing work on other CPUs can be done with async_run_on_cpu, which exits the idle loop in qemu_tcg_wait_io_event (this avoids the deadlocks). Checking that other CPUs have flushed the TLBs can be done in cpu_has_work ("always return false if cpu->halted == true there are outstanding TLB requests"). Paolo