[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/4] xen: introduce mc146818rtcxen
From: |
Stefano Stabellini |
Subject: |
Re: [Qemu-devel] [PATCH 1/4] xen: introduce mc146818rtcxen |
Date: |
Mon, 21 Nov 2011 11:05:20 +0000 |
User-agent: |
Alpine 2.00 (DEB 1167 2008-08-23) |
On Fri, 18 Nov 2011, Anthony Liguori wrote:
> On 11/18/2011 05:46 AM, Stefano Stabellini wrote:
> > On Tue, 15 Nov 2011, Stefano Stabellini wrote:
> >> On Tue, 15 Nov 2011, Anthony Liguori wrote:
> >>> On 11/15/2011 08:51 AM, address@hidden wrote:
> >>>> From: Stefano Stabellini<address@hidden>
> >>>>
> >>>> Xen doesn't need full RTC emulation in Qemu because the RTC is already
> >>>> emulated by the hypervisor. In particular we want to avoid the timers
> >>>> initialization so that Qemu doesn't need to wake up needlessly.
> >>>>
> >>>> Signed-off-by: Stefano Stabellini<address@hidden>
> >>>
> >>> Yuck. There's got to be a better way to do this.
> >>
> >> Yeah, it is pretty ugly, I was hoping in some good suggestions to
> >> improve this patch :)
> >>
> >>
> >>> I think it would be better to name timers and then in Xen specific
> >>> machine code,
> >>> disable the RTC timers.
> >>
> >> Good idea!
> >> I was thinking that I could implement an rtc_stop function in
> >> mc146818rtc.c that stops and frees the timers.
> >>
> >> Now the problem is that from xen-all.c I cannot easily find the
> >> ISADevice instance to pass to rtc_stop. Do you think it would be
> >> reasonable to call rtc_stop from pc_basic_device_init, inside the same
> >> if (!xen_available()) introduce by the next patch?
> >>
> >> Otherwise I could implement functions to walk the isa bus, similarly to
> >> pci_for_each_device.
> >>
> >
> > ping?
>
> Thinking more about it, I think this entire line of thinking is wrong
> (including
> mine) :-)
Actually I quite liked your suggestion of stopping the rtc_clock: the
patch becomes a one-liner in xen-all!
> The problem you're trying to solve is that the RTC fires two 1 second timers
> regardless of whether the guest is reading the wall clock time, right? And
> since wall clock time is never read from the QEMU RTC in Xen, it's a huge
> waste?
The real problem I am trying to solve is that I don't need an RTC clock
in Qemu. However it is not easy to disentangle the RTC emulation from
the rest of the system (see rtc_state in pc.c and pc_piix.c). So I would
be happy enough with just getting rid of the timers.
> The Right Solution would be to modify the RTC emulation such that it did a
> qemu_get_clock() during read of the CMOS registers in order to ensure the
> time
> was up to date (instead of using 1 second timers).
>
> Then the timers wouldn't even exist anymore.
That would be one way of doing it, however the timers don't only update
a clock variable, so removing them is certainly non-trivial and could
have unintended consequences. I am not sure it is worth it in this
context.
BTW the RTC emulation in Xen also has two timers.
- [Qemu-devel] [PATCH 0/4] prevent Qemu from waking up needlessly, Stefano Stabellini, 2011/11/15
- [Qemu-devel] [PATCH 2/4] xen: do not initialize the interval timer emulator, stefano.stabellini, 2011/11/15
- [Qemu-devel] [PATCH 1/4] xen: introduce mc146818rtcxen, stefano.stabellini, 2011/11/15
- Re: [Qemu-devel] [PATCH 1/4] xen: introduce mc146818rtcxen, Anthony Liguori, 2011/11/15
- Re: [Qemu-devel] [PATCH 1/4] xen: introduce mc146818rtcxen, Stefano Stabellini, 2011/11/15
- Re: [Qemu-devel] [PATCH 1/4] xen: introduce mc146818rtcxen, Stefano Stabellini, 2011/11/18
- Re: [Qemu-devel] [PATCH 1/4] xen: introduce mc146818rtcxen, Anthony Liguori, 2011/11/18
- Re: [Qemu-devel] [PATCH 1/4] xen: introduce mc146818rtcxen, Anthony Liguori, 2011/11/18
- Re: [Qemu-devel] [PATCH 1/4] xen: introduce mc146818rtcxen, Avi Kivity, 2011/11/20
- Re: [Qemu-devel] [PATCH 1/4] xen: introduce mc146818rtcxen, Anthony Liguori, 2011/11/21
- Re: [Qemu-devel] [PATCH 1/4] xen: introduce mc146818rtcxen,
Stefano Stabellini <=
- Re: [Qemu-devel] [PATCH 1/4] xen: introduce mc146818rtcxen, Paolo Bonzini, 2011/11/21
[Qemu-devel] [PATCH 4/4] qemu_calculate_timeout: increase minimum timeout to 1h, stefano.stabellini, 2011/11/15
[Qemu-devel] [PATCH 3/4] xen: introduce an event channel for buffered io event notifications, stefano.stabellini, 2011/11/15