* [PATCH v5] x86/cpu/intel: Fix the constant_tsc model check for Pentium 4
@ 2025-08-06 15:34 Suchit Karunakaran
2025-08-06 15:38 ` Suchit Karunakaran
2025-08-06 23:31 ` Sohil Mehta
0 siblings, 2 replies; 3+ messages in thread
From: Suchit Karunakaran @ 2025-08-06 15:34 UTC (permalink / raw)
To: tglx, mingo, bp, dave.hansen, hpa, darwi, sohil.mehta, peterz,
ravi.bangoria
Cc: skhan, linux-kernel-mentees, linux-kernel, Suchit Karunakaran,
stable
Pentium 4's which are INTEL_P4_PRESCOTT (model 0x03) and later have
a constant TSC. This was correctly captured until commit fadb6f569b10
("x86/cpu/intel: Limit the non-architectural constant_tsc model checks").
In that commit, an error was introduced while selecting the last P4
model (0x06) as the upper bound. Model 0x06 was transposed to
INTEL_P4_WILLAMETTE, which is just plain wrong. That was presumably a
simple typo, probably just copying and pasting the wrong P4 model.
Fix the constant TSC logic to cover all later P4 models. End at
INTEL_P4_CEDARMILL which accurately corresponds to the last P4 model.
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>
---
Changes since v4:
- Updated the patch based on review suggestions
Changes since v3:
- Refined changelog
Changes since v2:
- Improved commit message
Changes since v1:
- Fixed incorrect logic
arch/x86/kernel/cpu/intel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index 076eaa41b8c8..98ae4c37c93e 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -262,7 +262,7 @@ static void early_init_intel(struct cpuinfo_x86 *c)
if (c->x86_power & (1 << 8)) {
set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC);
- } else if ((c->x86_vfm >= INTEL_P4_PRESCOTT && c->x86_vfm <= INTEL_P4_WILLAMETTE) ||
+ } else if ((c->x86_vfm >= INTEL_P4_PRESCOTT && c->x86_vfm <= INTEL_P4_CEDARMILL) ||
(c->x86_vfm >= INTEL_CORE_YONAH && c->x86_vfm <= INTEL_IVYBRIDGE)) {
set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
}
--
2.50.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v5] x86/cpu/intel: Fix the constant_tsc model check for Pentium 4
2025-08-06 15:34 [PATCH v5] x86/cpu/intel: Fix the constant_tsc model check for Pentium 4 Suchit Karunakaran
@ 2025-08-06 15:38 ` Suchit Karunakaran
2025-08-06 23:31 ` Sohil Mehta
1 sibling, 0 replies; 3+ messages in thread
From: Suchit Karunakaran @ 2025-08-06 15:38 UTC (permalink / raw)
To: tglx, mingo, bp, dave.hansen, hpa, darwi, sohil.mehta, peterz,
ravi.bangoria
Cc: skhan, linux-kernel-mentees, linux-kernel, stable
On Wed, 6 Aug 2025 at 21:04, Suchit Karunakaran
<suchitkarunakaran@gmail.com> wrote:
>
> Pentium 4's which are INTEL_P4_PRESCOTT (model 0x03) and later have
> a constant TSC. This was correctly captured until commit fadb6f569b10
> ("x86/cpu/intel: Limit the non-architectural constant_tsc model checks").
>
> In that commit, an error was introduced while selecting the last P4
> model (0x06) as the upper bound. Model 0x06 was transposed to
> INTEL_P4_WILLAMETTE, which is just plain wrong. That was presumably a
> simple typo, probably just copying and pasting the wrong P4 model.
>
> Fix the constant TSC logic to cover all later P4 models. End at
> INTEL_P4_CEDARMILL which accurately corresponds to the last P4 model.
>
> 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>
> ---
> Changes since v4:
> - Updated the patch based on review suggestions
>
> Changes since v3:
> - Refined changelog
>
> Changes since v2:
> - Improved commit message
>
> Changes since v1:
> - Fixed incorrect logic
>
> arch/x86/kernel/cpu/intel.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
> index 076eaa41b8c8..98ae4c37c93e 100644
> --- a/arch/x86/kernel/cpu/intel.c
> +++ b/arch/x86/kernel/cpu/intel.c
> @@ -262,7 +262,7 @@ static void early_init_intel(struct cpuinfo_x86 *c)
> if (c->x86_power & (1 << 8)) {
> set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
> set_cpu_cap(c, X86_FEATURE_NONSTOP_TSC);
> - } else if ((c->x86_vfm >= INTEL_P4_PRESCOTT && c->x86_vfm <= INTEL_P4_WILLAMETTE) ||
> + } else if ((c->x86_vfm >= INTEL_P4_PRESCOTT && c->x86_vfm <= INTEL_P4_CEDARMILL) ||
> (c->x86_vfm >= INTEL_CORE_YONAH && c->x86_vfm <= INTEL_IVYBRIDGE)) {
> set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
> }
> --
> 2.50.1
Hi Sohil,
Could you please review the patch? I hope I haven't made any mistakes
this time, and if there are any, it was completely unintentional and I
apologise in advance.
Thanks,
Suchit
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v5] x86/cpu/intel: Fix the constant_tsc model check for Pentium 4
2025-08-06 15:34 [PATCH v5] x86/cpu/intel: Fix the constant_tsc model check for Pentium 4 Suchit Karunakaran
2025-08-06 15:38 ` Suchit Karunakaran
@ 2025-08-06 23:31 ` Sohil Mehta
1 sibling, 0 replies; 3+ messages in thread
From: Sohil Mehta @ 2025-08-06 23:31 UTC (permalink / raw)
To: Suchit Karunakaran, tglx, mingo, bp, dave.hansen, hpa, darwi,
peterz, ravi.bangoria
Cc: skhan, linux-kernel-mentees, linux-kernel, stable
On 8/6/2025 8:34 AM, Suchit Karunakaran wrote:
> Pentium 4's which are INTEL_P4_PRESCOTT (model 0x03) and later have
> a constant TSC. This was correctly captured until commit fadb6f569b10
> ("x86/cpu/intel: Limit the non-architectural constant_tsc model checks").
>
> In that commit, an error was introduced while selecting the last P4
> model (0x06) as the upper bound. Model 0x06 was transposed to
> INTEL_P4_WILLAMETTE, which is just plain wrong. That was presumably a
> simple typo, probably just copying and pasting the wrong P4 model.
>
> Fix the constant TSC logic to cover all later P4 models. End at
> INTEL_P4_CEDARMILL which accurately corresponds to the last P4 model.
>
> 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>
> ---
Reviewed-by: Sohil Mehta <sohil.mehta@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-06 23:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-06 15:34 [PATCH v5] x86/cpu/intel: Fix the constant_tsc model check for Pentium 4 Suchit Karunakaran
2025-08-06 15:38 ` Suchit Karunakaran
2025-08-06 23:31 ` Sohil Mehta
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).