Re: [PATCH] x86: Hyper-V: register clocksource only if its advertised

From: Olaf Hering
Date: Fri Jan 25 2013 - 11:54:39 EST


On Fri, Jan 25, KY Srinivasan wrote:

>
>
> > -----Original Message-----
> > From: Olaf Hering [mailto:olaf@xxxxxxxxx]
> > Sent: Friday, January 25, 2013 8:37 AM
> > To: linux-kernel@xxxxxxxxxxxxxxx
> > Cc: Olaf Hering; stable@xxxxxxxxxx; KY Srinivasan; Greg KH
> > Subject: [PATCH] x86: Hyper-V: register clocksource only if its advertised
> >
> > Enable hyperv_clocksource only if its advertised as a feature.
> > XenServer 6 returns the signature which is checked in
> > ms_hyperv_platform(), but it does not offer all features. Currently the
> > clocksource is enabled unconditionally in ms_hyperv_init_platform(), and
> > the result is a hanging guest.
> >
> > Hyper-V spec Bit 1 indicates the availability of Partition Reference
> > Counter. Register the clocksource only if this bit is set.
> >
> > The guest in question prints this in dmesg:
> > [ 0.000000] Hypervisor detected: Microsoft HyperV
> > [ 0.000000] HyperV: features 0x70, hints 0x0
> >
> > This bug can be reproduced easily be setting 'viridian=1' in a HVM domU
> > .cfg file. A workaround without this patch is to boot the HVM guest with
> > 'clocksource=jiffies'.
>
> I am curious why you are setting viridian=1 for a Linux HVM guest. Initially when
> I did the Hyper-V emulation work on Xen, this configuration flag would be set only
> for Windows guests since the idea was to run the "enlightened" Windows on Xen.
> While the current Xen emulation code does not emulate "Partition Reference Counter"
> there is no guarantee that Xen would not do this in the future. Perhaps dealing with this issue
> by identifying the guest (via the viridian domain or not) may be a safer approach?

I'm not sure if XenServer does that per default, but I used the
viridian= flag to reproduce the report.
If Xen starts to emulate the "Partition Reference Counter" it should
also advertise this emulation with the feature flag. Are you saying that
checking for features is not the right approach?

Olaf
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/