qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH v2 2/4] cadence_ttc: initial version of devi


From: Paul Brook
Subject: Re: [Qemu-devel] [RFC PATCH v2 2/4] cadence_ttc: initial version of device model
Date: Wed, 8 Feb 2012 10:15:25 +0000
User-agent: KMail/1.13.7 (Linux/3.1.0-1-amd64; KDE/4.6.5; x86_64; ; )

> > > Implemented cadence Triple Timer Counter (TCC)
> > 
> > It looks like you're implementing a periodic timer as sequence of chained
> > oneshot timers.  This is a bad idea.  In qemu interrupt latency may be
> > high,
> > so you're likely to suffer from significant time skew.
> > 
> Ok, I could implemented the wraparound event as a periodic timer and the
> match events are kicked off as seperate one-shot timers when the wrap
> around occurs? There would still be a small delay on match events, but it
> would get rid of the integration effect of lots of little delays (over many
> wrap arounds) add up to a significant skew.

I'm not sure why you need the oneshot timers at all. But then again I'm not 
really sure what the desired semantics are either :-)

It would help me if you could describe how these timers operate.
In particular:

- Are they free running.  i.e. keep counting until explicitly stopped by the 
user, or stop when an event occurs.
- When are interrupts raised.  You mention a user specified match value.  Do 
we also get an interrupt on wraparound?
- What happens when the timer hits the limit (zero if count-down, match value 
if count-up)? Does it wrap? or load a fixed value? 

If you've got independent wrap and match events then I guess yes, a periodic 
wrap plus a oneshot match event is probably appropriate.

If wrapping does not generate an interrupt, or wrap and match are effectively 
the same thing then you just need to transpose the counter onto a single 
periodic timer.

If the timers can be configured in both periodic and oneshot modes, then you 
may want to have different implementations based on that.

Paul



reply via email to

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