qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH v8 08/21] cpu: replay instructions sequence


From: Pavel Dovgaluk
Subject: Re: [Qemu-devel] [RFC PATCH v8 08/21] cpu: replay instructions sequence
Date: Tue, 17 Feb 2015 11:43:41 +0300

> From: Paolo Bonzini [mailto:address@hidden On Behalf Of Paolo Bonzini
> On 16/02/2015 14:37, Pavel Dovgaluk wrote:
> >> From: Paolo Bonzini [mailto:address@hidden On Behalf Of Paolo Bonzini
> >> On 16/02/2015 14:27, Pavel Dovgaluk wrote:
> >>>> From: Paolo Bonzini [mailto:address@hidden On Behalf Of Paolo Bonzini
> >>>> On 16/02/2015 13:26, Pavel Dovgaluk wrote:
> >>>>>>>>> I think in this case there are no events at all - just reading 
> >>>>>>>>> timers values
> >>>>>>>>> that were made while recording.
> >>>>>>>>> We have to replay these reads by waking iothread.
> >>>>>>>
> >>>>>>> I think the right place for this is in replay_read_next_clock then.
> >>>>> It doesn't fit. Log file is not read until all instructions are 
> >>>>> executed.
> >>>>> And the next read from the file should be performed by iothread which 
> >>>>> should
> >>>>> be notified and waked up.
> >>>>
> >>>> I still don't understand.  If you're getting EXCP_INTERRUPT it means:
> >>>>
> >>>> 1) that cpu_signal was called
> >>>
> >>> No, it isn't. That is the branch when icount is expired.
> >>> And when it is expired in replay mode we have to wake up iothread,
> >>> because nobody will care about this.
> >>
> >> Then it's done here in qemu_tcg_cpu_thread_fn:
> >
> > Do you mean that I should put iothread notification right here?
> 
> It already notifies the iothread.
> 
> > Or that this code duplicates my patch?
> > If the second one then I guess that it doesn't help and I need to make 
> > additional checks
> about it.
> 
> Yes.  You can modify your patch to do:
> 
>      int64_t deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL);
>      if (deadline == 0) {
>          qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
>      }
> 
> instead of qemu_notify_event(), and remove these lines from
> qemu_tcg_cpu_thread_fn.

I tried this one. But there is one problem.
Expiring of the virtual timers is not the only reason of icount expiration in 
replay mode.
It may be caused by host timers deadline or poll timeout in record mode. In 
this case 
qemu_clock_notify(QEMU_CLOCK_VIRTUAL) will not be called in replay mode and 
we'll waste time for iothread sleeping.


Pavel Dovgalyuk




reply via email to

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