On Fri, Jan 31, 2025, Sean Christopherson wrote:
> +static inline int cpuid_get_tsc_freq(unsigned int *tsc_khz,
> +                                  unsigned int *crystal_khz)
> +{
> +     unsigned int denominator, numerator;
> +
> +     if (cpuid_get_tsc_info(tsc_khz, &denominator, &numerator))

As pointed out by Dan, this is broken.  It should be crystal_khz, not tsc_khz.
I fixed the bug in my test build but clobbered it before posting.

> +             return -ENOENT;
> +
> +     if (!*crystal_khz)
> +             return -ENOENT;
> +
> +     *tsc_khz = *crystal_khz * numerator / denominator;
> +     return 0;
> +}

Reply via email to