qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Pavel Dovgaluk
Subject: Re: [Qemu-devel] [RFC PATCH v5 07/31] icount: implement icount requesting
Date: Fri, 5 Dec 2014 13:55:42 +0300

> From: Paolo Bonzini [mailto:address@hidden
> On 05/12/2014 06:34, Pavel Dovgaluk wrote:
> >> From: Paolo Bonzini [mailto:address@hidden
> >> 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). It is correct (because no block is 
> >>> executing
> >>> at that moment) but is different to prior usage of icount requests.
> >>
> >> Why is !cpu_can_do_io(cpu) if no block is executing?
> >
> > Because it returns cpu->can_do_io which is equal to zero at that moment.
> 
> 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 (port io, raising interrupt)
operations only at the end of the translation blocks.
When someone tries to use MMIO in the middle of TB, that TB is
recompiled to place this instruction at the end of the block.

Do you mean that we can set can_do_io before execution of the block
and reset it at the beginning of the execution?

Pavel Dovgalyuk




reply via email to

[Prev in Thread] Current Thread [Next in Thread]