From: Tim Deegan Subject: Re: Time Skewing on Windows XP Date: Thu, 14 Mar 2013 17:08:34 +0000 Message-ID: <20130314170834.GF5174@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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <51420C5C02000078000C5A45@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 16:43 +0000 on 14 Mar (1363279436), Jan Beulich wrote: > >>> On 14.03.13 at 17:30, Tim Deegan wrote: > > At 16:06 +0000 on 14 Mar (1363277205), Jan Beulich wrote: > >> >>> On 14.03.13 at 16:16, Suravee Suthikulanit > > wrote: > >> > I finally traced the issue back to the patch that this first happened. > > This > >> > bug started in the patch : > >> > > >> > H86/HVM: assorted RTC emulation adjustment (w/ git commit id > >> > 620d5dad54008e40798c4a0c4322aef274c36fa3) > >> > > >> > I believe there are some issues with the changes in rtc_ioport_read in the > >> > arch/x86/hvm/rtc.c and in the pt_update_irq(). > >> > >> One thing you may want to try is remove the call from REG_C > >> read to rtc_timer_update() again - on a second thought it may > >> be wrong to do it here, as (other than check_update_timer() > >> and alarm_timer_update()) the function doesn't change with > >> RTC_PF getting cleared (i.e. I may have wrongly added the call > >> in analogy to the other two). > > > > The call is needed because of the new code in rtc_periodic_interrupt() > > that disables the timer if a second passes with no RTC_C read to clear > > the RTC_PF flag. > > Ah, right, of course. You see that it was many months back that I > wrote that code. > > So we could filter on this periodic timer not currently being active > (which ought to be better than your calling into > create_periodic_time() with just the time delta adjusted). I tried adding a flag and gating on it but it didn't fix the drift. I may have got it wrong, or there may be something about piix4 RTCs that Windows expects. Reading the piix4 spec it's not at all clear that leaving RTC_PF set suppresses interrupts (even if that's how an RTC ought to behave).