Re: [PATCH RFC] x86/tsc: Make recalibration default on for TSC_KNOWN_FREQ cases

From: Dave Hansen
Date: Fri Jun 02 2023 - 14:37:00 EST


On 6/2/23 11:29, Paul E. McKenney wrote:
>>> One downside is, many VMs also has X86_FEATURE_TSC_KNOWN_FREQ set,
>>> and they will also do this recalibration.
>> It's also pointless for those SoCs which lack legacy hardware.
>>
>> So why do you force this on everyone?
> Just for the record, this patch could be helpful in allowing victims
> of TSC mis-synchronization to more easily provide a more complete bug
> report to the firmware people. There is of course no point if there is
> already a fix available.
>
> But it is not all that hard to work around not having this patch upstream.
> This can be hand-applied as needed, NTP drift rates can be pressed
> into service for those of us having atomic clocks near all our servers,
> or the firmware guys can be tasked with figuring it out.
>
> So this patch would be nice to have, but we could live without it.

Is this the kind of thing we could relegate to a kernel unit test? Like
make the recalibration logic _available_, but don't have it affect the
rest of the system.

I love patching my kernel as much as the next guy. But, you know what I
*don't* love? Explaining how to patch kernels to other people. ;)