qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [PATCH 0/5] Refactor and enhance RTC configuration


From: Jan Kiszka
Subject: [Qemu-devel] Re: [PATCH 0/5] Refactor and enhance RTC configuration
Date: Wed, 09 Sep 2009 21:13:49 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

Blue Swirl wrote:
> On Wed, Sep 9, 2009 at 6:11 PM, Jan Kiszka<address@hidden> wrote:
>> The aim of this series is to allow using the emulated PC RTC (MC146818)
>> as a reliable time source for guests. This is particularly useful if the
>> host runs NTP or has otherwise access to an accurate clock while the
>> guest has not (no network, impossible to add an NTP implementation
>> etc.).
> 
> What I meant in the earlier thread is that m48t59 port read for time
> or date gets the data directly from host using  qemu_get_timedate().
> PC RTC instead uses a timer: the timer callback updates the cmos_data
> structure. It seems that you just replace the timer with a new one.
> I'd remove the timer altogether and change the cmos_ioport_read to
> call qemu_get_timedate().

That was my first idea as well, but the timer is there to emulate real
hardware behavior: Updates only take place while the UIP flag is set in
register A, and they take a few hundred microseconds. Guests actually
wait for this to happen and only read out after such a change. Moreover,
updates can trigger interrupts.

For sure one could avoid these update timers. But as they are so rare (1
HZ...), I didn't want to prematurely optimize the code here, risking
regressions while trying to fix our problems.

Jan

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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