Re: [Qemu-devel] [RFC PATCH v5 07/31] icount: implement icount requesting

2014-12-05 Thread Paolo Bonzini
On 05/12/2014 13:59, Pavel Dovgaluk wrote: >> From: Paolo Bonzini [mailto:pbonz...@redhat.com] >> On 05/12/2014 11:55, Pavel Dovgaluk wrote: > > And why is can_do_io zero? :) Is the fix to move the place where > can_do_io becomes nonzero? >>> can_do_io is set by gen_io_start function

Re: [Qemu-devel] [RFC PATCH v5 07/31] icount: implement icount requesting

2014-12-05 Thread Pavel Dovgaluk
> From: Paolo Bonzini [mailto:pbonz...@redhat.com] > On 05/12/2014 11:55, Pavel Dovgaluk wrote: > >> > > >> > And why is can_do_io zero? :) Is the fix to move the place where > >> > can_do_io becomes nonzero? > > can_do_io is set by gen_io_start function. > > As I understand, it is used to protect

Re: [Qemu-devel] [RFC PATCH v5 07/31] icount: implement icount requesting

2014-12-05 Thread Paolo Bonzini
On 05/12/2014 11:55, Pavel Dovgaluk wrote: >> > >> > And why is can_do_io zero? :) Is the fix to move the place where >> > can_do_io becomes nonzero? > can_do_io is set by gen_io_start function. > As I understand, it is used to protect determinism in icount mode, > because it allows non-determi

Re: [Qemu-devel] [RFC PATCH v5 07/31] icount: implement icount requesting

2014-12-05 Thread Pavel Dovgaluk
> From: Paolo Bonzini [mailto:pbonz...@redhat.com] > On 05/12/2014 06:34, Pavel Dovgaluk wrote: > >> From: Paolo Bonzini [mailto:pbonz...@redhat.com] > >> On 04/12/2014 12:02, Pavel Dovgaluk wrote: > > Why do you need to do this if !cpu_can_do_io(cpu)? > >>> We save number of executed instructi

Re: [Qemu-devel] [RFC PATCH v5 07/31] icount: implement icount requesting

2014-12-05 Thread Paolo Bonzini
On 05/12/2014 06:34, Pavel Dovgaluk wrote: >> From: Paolo Bonzini [mailto:pbonz...@redhat.com] >> On 04/12/2014 12:02, Pavel Dovgaluk wrote: > Why do you need to do this if !cpu_can_do_io(cpu)? >>> We save number of executed instruction when saving interrupt or exception >>> event. >>> It le

Re: [Qemu-devel] [RFC PATCH v5 07/31] icount: implement icount requesting

2014-12-04 Thread Pavel Dovgaluk
> From: Paolo Bonzini [mailto:pbonz...@redhat.com] > On 04/12/2014 12:02, Pavel Dovgaluk wrote: > >> > Why do you need to do this if !cpu_can_do_io(cpu)? > > We save number of executed instruction when saving interrupt or exception > > event. > > It leads to the call of cpu_get_instructions_counte

Re: [Qemu-devel] [RFC PATCH v5 07/31] icount: implement icount requesting

2014-12-04 Thread Paolo Bonzini
On 04/12/2014 12:02, Pavel Dovgaluk wrote: >> > Why do you need to do this if !cpu_can_do_io(cpu)? > We save number of executed instruction when saving interrupt or exception > event. > It leads to the call of cpu_get_instructions_counter() from cpu_exec function > (through several replay functi

Re: [Qemu-devel] [RFC PATCH v5 07/31] icount: implement icount requesting

2014-12-04 Thread Pavel Dovgaluk
> From: Paolo Bonzini [mailto:paolo.bonz...@gmail.com] On Behalf Of Paolo > Bonzini > On 26/11/2014 11:39, Pavel Dovgalyuk wrote: > > +int64_t cpu_get_instructions_counter(void) > > +{ > > +/* This function calls are synchnonized to timer changes, > > + calling cpu_get_instructions_count

Re: [Qemu-devel] [RFC PATCH v5 07/31] icount: implement icount requesting

2014-12-03 Thread Paolo Bonzini
On 26/11/2014 11:39, Pavel Dovgalyuk wrote: > +int64_t cpu_get_instructions_counter(void) > +{ > +/* This function calls are synchnonized to timer changes, > + calling cpu_get_instructions_counter_locked without lock is safe */ > +int64_t icount = timers_state.qemu_icount; > +CP

[Qemu-devel] [RFC PATCH v5 07/31] icount: implement icount requesting

2014-11-26 Thread Pavel Dovgalyuk
Replay uses number of executed instructions to determine corrent events injection moments. This patch introduces new function for querying the instructions counter. Signed-off-by: Pavel Dovgalyuk --- cpus.c | 26 +++--- include/qemu/timer.h |1 + 2 files c