From: Tim Deegan Subject: Re: Time Skewing on Windows XP Date: Thu, 21 Mar 2013 12:33:58 +0000 Message-ID: <20130321123358.GF12338@ocelot.phlegethon.org> References: <513EB1BC.9050803@amd.com> <513EEF5102000078000C4C89@nat28.tlf.novell.com> <5141E9CB.9020608@amd.com> <514203A502000078000C59E2@nat28.tlf.novell.com> <20130314163039.GD5174@ocelot.phlegethon.org> <51420C5C02000078000C5A45@nat28.tlf.novell.com> <20130314170834.GF5174@ocelot.phlegethon.org> <514231BC.301@amd.com> <5142E8A702000078000C5D1C@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <5142E8A702000078000C5D1C@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: George.Dunlap@eu.citrix.com, Suravee Suthikulanit , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org At 08:23 +0000 on 15 Mar (1363335830), Jan Beulich wrote: > >>> On 14.03.13 at 21:23, Suravee Suthikulanit wrote: > > So far, this patch allows me to get the correct timing on the XP. > > At the price of never stopping the periodic time - other than said > yesterday, _that_ was the main point of the flow change. I.e. > making the host wake up more frequently even on an otherwise > idle system. > > It ought to be possible to keep the timer off when unused by > the guest _and_ have the time remain stable... Sure, but right now, timekeeping in XP is totally borked. So we should probably revert 620d5dad54008e40798c4a0c4322aef274c36fa3 until a proper fix can be found. Cheers, Tim. > > --- a/xen/arch/x86/hvm/rtc.c > > +++ b/xen/arch/x86/hvm/rtc.c > > @@ -76,6 +76,15 @@ void rtc_periodic_interrupt(void *opaque) > > spin_unlock(&s->lock); > > } > > > > +static void rtc_periodic_cb(struct vcpu *v, void *opaque) > > +{ > > + RTCState *s = opaque; > > + > > + spin_lock(&s->lock); > > + s->hw.cmos_data[RTC_REG_C] |= RTC_PF | RTC_IRQF; > > + spin_unlock(&s->lock); > > +} > > And if we indeed revert that part of the original patch, then > properly - this function then ought to replace the now dead > rtc_periodic_interrupt(). > > Jan > > > + > > /* Enable/configure/disable the periodic timer based on the RTC_PIE and > > * RTC_RATE_SELECT settings */ > > static void rtc_timer_update(RTCState *s) > > @@ -98,7 +107,7 @@ static void rtc_timer_update(RTCState *s) > > { > > period = 1 << (period_code - 1); /* period in 32 Khz cycles */ > > period = DIV_ROUND(period * 1000000000ULL, 32768); /* in ns */ > > - create_periodic_time(v, &s->pt, period, period, RTC_IRQ, > > NULL, s); > > + create_periodic_time(v, &s->pt, period, period, RTC_IRQ, > > rtc_periodic_cb, s); > > break; > > } > > /* fall through */ > > @@ -619,7 +628,6 @@ static uint32_t rtc_ioport_read(RTCState *s, > > uint32_t addr) > > s->hw.cmos_data[RTC_REG_C] = 0x00; > > check_update_timer(s); > > alarm_timer_update(s); > > - rtc_timer_update(s); > > break; > > default: > > ret = s->hw.cmos_data[s->hw.cmos_index]; > > diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c > > index 46d3ec6..9c1dbfb 100644 > > --- a/xen/arch/x86/hvm/vpt.c > > +++ b/xen/arch/x86/hvm/vpt.c > > @@ -259,8 +259,6 @@ int pt_update_irq(struct vcpu *v) > > > > if ( is_lapic ) > > vlapic_set_irq(vcpu_vlapic(v), irq, 0); > > - else if ( irq == RTC_IRQ && pt_priv ) > > - rtc_periodic_interrupt(pt_priv); > > else > > { > > hvm_isa_irq_deassert(v->domain, irq); > > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel