Port-sparc archive

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

Re: NetBSD/sparc running on qemu



On Sat, Jan 16, 2010 at 08:14:22PM +0100, Manuel Bouyer wrote:
> And I guess, in your second test, sleep 10 still takes
> 20 real seconds, right ?
> That would mean that on qemu-i386, the acpi source is right, but the
> clockinterrupt one is wrong, just like as timer0 at obio0 on sparc.
> 
> I'll try to see how acpi is different from other clock sources in qemu.

OK, I found the issue. It's not "acpi timer is right, i8259 or
sparc's timer is wrong". It's whenever the clock interrupt and timecounter
sources are different or not.
qemu can't keep up with an interrupt rate of 100Hz (maybe because
the host system's scheduler itself is running at 100Hz), it seems it
can't do better than 50Hz.
When the timecounter source is in free run mode, the system will notice that
the interrupt is late (just ding the difference between the timecounter read
of 2 interrupts) and will correct the TOD accordingly.
When the timecounter source is also used as clock source, it will be reset
on every interrupt, so the system can't use it to correct the
clock's interrupt skew.

The fix for this is to build a kernel with a HZ qemu can handle. with HZ=25
the time is perfectly accurate on NetBSD/sparc in qemu.

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index