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 leads to the call

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 instruction when saving

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-deterministic

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 determinism in

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. As I understand,

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_counter_locked

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 functions).

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_counter() from

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; +