Re: [PATCH v3] x86/cpu/intel: Fix the constant_tsc model check for Pentium 4s

Greg KH
2025-07-30T04:52:45Z

On Wed, Jul 30, 2025 at 09:56:17AM +0530, Suchit Karunakaran wrote:
> The logic to synthesize constant_tsc for Pentium 4s (Family 15) is
> wrong. Since INTEL_P4_PRESCOTT is numerically greater than
> INTEL_P4_WILLAMETTE, the logic always results in false and never sets
> X86_FEATURE_CONSTANT_TSC for any Pentium 4 model.
> The error was introduced while replacing the x86_model check with a VFM
> one. The original check was as follows:
> if ((c->x86 == 0xf && c->x86_model >= 0x03) ||
> (c->x86 == 0x6 && c->x86_model >= 0x0e))
> set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);

What do you mean by "original check"? Before the change that caused
this, or what it should be?

> Fix the logic to cover all Pentium 4 models from Prescott (model 3) to
> Cedarmill (model 6) which is the last model released in Family 15.
>
> Fixes: fadb6f569b10 ("x86/cpu/intel: Limit the non-architectural constant_tsc model checks")
>
> Cc: <stable@vger.kernel.org> # v6.15
>
> Signed-off-by: Suchit Karunakaran <suchitkarunakaran@gmail.com>

Nit, no blank lines beween all of those last lines. Hint, look at all
of the patches on the mailing lists AND in the tree already, you have
hundreds of thousands of examples here of how to format things :)

thanks,

greg k-h