On 12 May 2015 at 19:17, Paolo Bonzini <pbonz...@redhat.com> wrote: > On 12/05/2015 17:32, Peter Maydell wrote: >> In order for -icount to work, it's important for the target >> translate.c code to correctly bracket any generated code which >> can "do I/O" with gen_io_start()/gen_io_end() calls. But >> does anybody know exactly what the criteria are here for this? >> It would be nice if we could document this in a comment in >> gen_icount.h -- I'm happy to write one up if somebody will just >> tell me what the right answer is :-) > > It's any instruction that can cause an icount read, typically through > QEMU_CLOCK_VIRTUAL or cpu_get_ticks().
Also anything that can cause a CPU interrupt, since tcg_handle_interrupt() will call cpu_abort() if the CPU gets an interrupt while it's not in a 'can do IO' state. Anything else? [How are -icount and multi-threaded TCG going to interact? Do we just say "you get one or the other but not both" ?] -- PMM