Re: [PATCH] x86: tsc: fix L2 guest always in tsc_early clocksource

From: Peter Zijlstra
Date: Mon Apr 23 2018 - 15:37:48 EST


On Tue, Apr 24, 2018 at 09:08:54AM +0800, Peng Hao wrote:
> In L2 guest tsc_read_refs always return ULLONG_MAX, and that will
> call tsc_refine_calibration_work periodly. So L2 guest will read
> acpi timer port 0x608 periodly.
> The patch will let it out of "if(tsc_start == -1){}" infinite loop.

Help me out a little. What's an L2 guest?

And I'm assuming you don't have HPET and then end up wanting to use
PM-timer? Which is also busted and resturns crap results?

So if the whole TSC sync has no way of ever working; what is your patch
doing? How is the actual TSC calibrated?

Should you instead be using fast_calibrate() and passing in a known
value from the host? Thereby avoiding all this calibration nonsense
entirely.