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

Re: [Xen-devel] [PATCH v3] x86/hvm/hpet: avoid 'small' time diff test on resume


  • To: 'Jan Beulich' <JBeulich@xxxxxxxx>
  • From: Paul Durrant <Paul.Durrant@xxxxxxxxxx>
  • Date: Wed, 29 May 2019 16:02:35 +0000
  • Accept-language: en-GB, en-US
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=Paul.Durrant@xxxxxxxxxx; spf=Pass smtp.mailfrom=Paul.Durrant@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxxxxxxxxxxxxx
  • Cc: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, WeiLiu <wl@xxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Delivery-date: Wed, 29 May 2019 16:02:45 +0000
  • Ironport-sdr: tb8v3RyBSr+o/0lcwJQyTKQpK/3hv1Bw2E3G0otSE8saJuYiXNG1cvf/42lk/XYYnrtXw3JKc+ k0XtPMWVQL/95j8xbTSlphQ6uM+tx1eDiUdQCL6YIIiYhJ7wwzw+qpFnPpFz9yPpHQJqy8CJHx 8GxhQzOzItAlpAVOJTQFyc3mq7kvfi85RGNEn6tRWCOx76cIdkn9x40WCDdoDxareNzqz901lc 0E5Ea7WH2KEzmr1bas3hJSH9XjJ2QMixO313+pJ+UVKFxSa7Kp6vsCJP7mR695tfMCYlyzUKhW kUM=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVFifnLLnXBFkwn06i0hwRb+2sX6aCIU4AgAAh3gA=
  • Thread-topic: [PATCH v3] x86/hvm/hpet: avoid 'small' time diff test on resume

> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@xxxxxxxx]
> Sent: 29 May 2019 17:00
> To: Paul Durrant <Paul.Durrant@xxxxxxxxxx>
> Cc: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>; Roger Pau Monne 
> <roger.pau@xxxxxxxxxx>; xen-devel <xen-
> devel@xxxxxxxxxxxxxxxxxxxx>; WeiLiu <wl@xxxxxxx>
> Subject: Re: [PATCH v3] x86/hvm/hpet: avoid 'small' time diff test on resume
> 
> >>> On 29.05.19 at 16:07, <paul.durrant@xxxxxxxxxx> wrote:
> > It appears that even 64-bit versions of Windows 10, when not using syth-
> > etic timers, will use 32-bit HPET non-periodic timers. There is a test
> > in hpet_set_timer(), specific to 32-bit timers, that tries to disambiguate
> > between a comparator value that is in the past and one that is sufficiently
> > far in the future that it wraps. This is done by assuming that the delta
> > between the main counter and comparator will be 'small' [1], if the
> > comparator value is in the past. Unfortunately, more often than not, this
> > is not the case if the timer is being re-started after a migrate and so
> > the timer is set to fire far in the future (in excess of a minute in
> > several observed cases) rather then set to fire immediately. This has a
> > rather odd symptom where the guest console is alive enough to be able to
> > deal with mouse pointer re-rendering, but any keyboard activity or mouse
> > clicks yield no response.
> >
> > This patch simply adds an extra check of 'creation_finished' into
> > hpet_set_timer() so that the 'small' time test is omitted when the function
> > is called to restart timers after migration, and thus any negative delta
> > causes a timer to fire immediately.
> >
> > [1] The number of ticks that equate to 0.9765625 milliseconds
> >
> > Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
> 
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
> 

Thanks.

> > I notice that we seemingly don't handle main counter wrap in the HPET code.
> > The spec. says that timers should fire at the point the counter wraps at the
> > timer's width. I think the need for the 'small' time test would go away if
> > this was implemented, but that's for another day.
> 
> For posterity I would have hoped you would update this remark as
> well.

Oops, sorry, yes I forgot to update this part of the commit comment. FTR the 
spec does only state that the timer should fire when a 32-bit timer counter 
wraps.

  Paul

> 
> Jan
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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