Re: [Qemu-devel] when does a target frontend need to use gen_io_start()/gen_io_end() ?

2015-05-13 Thread Paolo Bonzini
On 13/05/2015 08:57, Pavel Dovgaluk wrote: It's any instruction that can cause an icount read, typically through QEMU_CLOCK_VIRTUAL or cpu_get_ticks(). Doesn't this mean that ARM has incorrect implementation of icount? MMIO is common for this platform, but none of memory accesses are

Re: [Qemu-devel] when does a target frontend need to use gen_io_start()/gen_io_end() ?

2015-05-13 Thread Paolo Bonzini
On 13/05/2015 11:41, Peter Maydell wrote: For -icount and SMP, yes. I even posted a patch to that end once. I don't see why -icount and SMP need to be mutually exclusive. If we're round-robining between the SMP CPUs then they should all stay deterministic, I would have thought? No,

Re: [Qemu-devel] when does a target frontend need to use gen_io_start()/gen_io_end() ?

2015-05-13 Thread Paolo Bonzini
On 12/05/2015 21:41, Peter Maydell wrote: 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

Re: [Qemu-devel] when does a target frontend need to use gen_io_start()/gen_io_end() ?

2015-05-13 Thread Peter Maydell
On 13 May 2015 at 09:42, Paolo Bonzini pbonz...@redhat.com wrote: On 12/05/2015 21:41, Peter Maydell wrote: 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

Re: [Qemu-devel] when does a target frontend need to use gen_io_start()/gen_io_end() ?

2015-05-13 Thread Frederic Konrad
Hi, On 13/05/2015 12:03, Paolo Bonzini wrote: On 13/05/2015 11:41, Peter Maydell wrote: For -icount and SMP, yes. I even posted a patch to that end once. I don't see why -icount and SMP need to be mutually exclusive. If we're round-robining between the SMP CPUs then they should all stay

Re: [Qemu-devel] when does a target frontend need to use gen_io_start()/gen_io_end() ?

2015-05-13 Thread Pavel Dovgaluk
From: Paolo Bonzini [mailto:paolo.bonz...@gmail.com] On Behalf Of Paolo Bonzini 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()

Re: [Qemu-devel] when does a target frontend need to use gen_io_start()/gen_io_end() ?

2015-05-12 Thread Paolo Bonzini
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

Re: [Qemu-devel] when does a target frontend need to use gen_io_start()/gen_io_end() ?

2015-05-12 Thread Peter Maydell
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

[Qemu-devel] when does a target frontend need to use gen_io_start()/gen_io_end() ?

2015-05-12 Thread Peter Maydell
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

Re: [Qemu-devel] when does a target frontend need to use gen_io_start()/gen_io_end() ?

2015-05-12 Thread Richard Henderson
On 05/12/2015 08:32 AM, 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

Re: [Qemu-devel] when does a target frontend need to use gen_io_start()/gen_io_end() ?

2015-05-12 Thread Peter Maydell
On 12 May 2015 at 16:43, Richard Henderson r...@twiddle.net wrote: On 05/12/2015 08:32 AM, 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