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

Re: [Xen-devel] Time Skewing on Windows XP



>>> On 14.03.13 at 21:23, Suravee Suthikulanit <suravee.suthikulpanit@xxxxxxx> 
>>> 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...

> --- 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@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.