On Thu, 2026-08-06 at 16:35 -0700, Sean Christopherson wrote:
> As pointed out by Sashiko[*], kvmclock_init() runs before __setup() and
> thus before notsc_setup() or tsc_setup() can mark the TSC unstable.
> kvmclock_init() also runs well before tsc_init(), and even before
> tsc_early_init().  Simply delete the check, as it's been dead code since
> it was introduced.
>
> Note, odds are good the check_tsc_unstable() call was copied from Xen's
> xen_time_init()+xen_tsc_safe_clocksource() logic (as so much of KVM's PV
> code was).  However, xen_time_init() runs via x86_init.timers.timer_init(),
> which is invoke from x86_late_time_init(), and thus after params have been
> parsed.
>
> Alternatively, kvmclock could register itself later on, or tsc_setup()
> could be parsed as an early param.  Given that there's zero evidence there
> was any meaningful intent or need to actually check for an unstable TSC,
> go with the simplest option.
>
> Fixes: 7539b174aef4 ("x86: kvmguest: use TSC clocksource if invariant TSC is 
> exposed")
> Link: https://lore.kernel.org/all/[email protected] 
> [*]
> Signed-off-by: Sean Christopherson <[email protected]>

Reviewed-by: David Woodhouse <[email protected]>

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to