* [PATCH v3 0/3] x86: Fix a F00F bug warning and cleanup surrounding code
@ 2026-05-18 22:17 Sohil Mehta
2026-05-18 22:17 ` [PATCH v3 1/3] x86/cpu/intel: Don't clear X86_BUG_F00F before setting it Sohil Mehta
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Sohil Mehta @ 2026-05-18 22:17 UTC (permalink / raw)
To: Dave Hansen, Borislav Petkov, x86
Cc: Thomas Gleixner, Ingo Molnar, H . Peter Anvin, Josh Poimboeuf,
Richard Weinberger, Andrew Cooper, Tony Luck, Sohil Mehta,
Ahmed S . Darwish, linux-kernel
Changes in v3:
- Remove the notice announcing the F00F bug workaround instead of
simplifying it.
- Pick up review tags from Ahmed.
v2: https://lore.kernel.org/all/20260515002500.2463393-1-sohil.mehta@intel.com/
Summary:
The series fixes a harmless "alternatives_patched" warning that affects
the original Pentium (Family 5) processors with SMP. It also removes the
kernel announcement that the F00F bug workaround is in place. Mainly,
the patches simplify and reduce lines of code.
Original v1 post by Richard Weinberger:
https://lore.kernel.org/lkml/20260216104343.3625292-1-richard@nod.at/
The Fixes tag in patch 1 isn't strictly necessary. I left it inplace as
Richard had it in his original series, but it can be removed to avoid
backporting hassles.
Richard Weinberger (2):
x86/cpu/intel: Don't clear X86_BUG_F00F before setting it
x86/cpufeature: Remove clear_cpu_bug()
Sohil Mehta (1):
x86/cpu/intel: Remove the F00F bug workaround notice
arch/x86/include/asm/cpufeature.h | 1 -
arch/x86/kernel/cpu/intel.c | 15 +++------------
2 files changed, 3 insertions(+), 13 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v3 1/3] x86/cpu/intel: Don't clear X86_BUG_F00F before setting it
2026-05-18 22:17 [PATCH v3 0/3] x86: Fix a F00F bug warning and cleanup surrounding code Sohil Mehta
@ 2026-05-18 22:17 ` Sohil Mehta
2026-05-18 22:17 ` [PATCH v3 2/3] x86/cpu/intel: Remove the F00F bug workaround notice Sohil Mehta
` (2 subsequent siblings)
3 siblings, 0 replies; 11+ messages in thread
From: Sohil Mehta @ 2026-05-18 22:17 UTC (permalink / raw)
To: Dave Hansen, Borislav Petkov, x86
Cc: Thomas Gleixner, Ingo Molnar, H . Peter Anvin, Josh Poimboeuf,
Richard Weinberger, Andrew Cooper, Tony Luck, Sohil Mehta,
Ahmed S . Darwish, linux-kernel
From: Richard Weinberger <richard@nod.at>
On x86 SMP systems with the F00F bug present, the following warning
occurs for each AP:
WARNING: arch/x86/kernel/cpu/cpuid-deps.c:126 at do_clear_cpu_cap+0xb4/0x110
Call Trace:
clear_cpu_cap+0x8/0x10
init_intel+0x1b/0x4b0
identify_cpu+0x154/0x750
identify_secondary_cpu+0x3d/0x90
start_secondary+0x6b/0xf0
startup_32_smp+0x151/0x160
The X86_BUG_F00F flag is first cleared in intel_workarounds() and then
set for the affected models. This sequence works fine on the BSP but on
AP bringup, where alternatives have already been patched, clearing the
flag triggers the warning.
There is no technical reason for clearing the flag before setting it.
It is mainly an artifact of the introduction of X86_BUG_F00F in commit
e2604b49e8a8 ("x86, cpu: Convert F00F bug detection"). Remove the
unnecessary clearing of the flag.
Note that the fixes tag references a recent commit that introduced the
warning rather than the old commit that converted F00F bug detection to
use clear_cpu_bug().
Fixes: ee8962082a44 ("x86/alternatives: Catch late X86_FEATURE modifiers")
Signed-off-by: Richard Weinberger <richard@nod.at>
[sohil: reworded the commit message]
Signed-off-by: Sohil Mehta <sohil.mehta@intel.com>
Reviewed-by: Ahmed S. Darwish <darwi@linutronix.de>
---
v3:
- Picked up Ahmed's review tag.
v2:
- Reworded commit message to clarify the issue.
---
arch/x86/kernel/cpu/intel.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index f28c0efb7c8f..e957c5a1501c 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -395,7 +395,6 @@ static void intel_workarounds(struct cpuinfo_x86 *c)
* system. Announce that the fault handler will be checking for it.
* The Quark is also family 5, but does not have the same bug.
*/
- clear_cpu_bug(c, X86_BUG_F00F);
if (c->x86_vfm >= INTEL_FAM5_START && c->x86_vfm < INTEL_QUARK_X1000) {
static int f00f_workaround_enabled;
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 2/3] x86/cpu/intel: Remove the F00F bug workaround notice
2026-05-18 22:17 [PATCH v3 0/3] x86: Fix a F00F bug warning and cleanup surrounding code Sohil Mehta
2026-05-18 22:17 ` [PATCH v3 1/3] x86/cpu/intel: Don't clear X86_BUG_F00F before setting it Sohil Mehta
@ 2026-05-18 22:17 ` Sohil Mehta
2026-05-19 9:00 ` Ahmed S. Darwish
2026-05-18 22:17 ` [PATCH v3 3/3] x86/cpufeature: Remove clear_cpu_bug() Sohil Mehta
2026-05-24 16:33 ` [PATCH v3 0/3] x86: Fix a F00F bug warning and cleanup surrounding code Borislav Petkov
3 siblings, 1 reply; 11+ messages in thread
From: Sohil Mehta @ 2026-05-18 22:17 UTC (permalink / raw)
To: Dave Hansen, Borislav Petkov, x86
Cc: Thomas Gleixner, Ingo Molnar, H . Peter Anvin, Josh Poimboeuf,
Richard Weinberger, Andrew Cooper, Tony Luck, Sohil Mehta,
Ahmed S . Darwish, linux-kernel
The F00F bug workaround announcement goes through a lot of effort to
print the kernel notice exactly once. CPU bugs with workarounds
typically don't require user notifications. If needed, the presence of
the F00F bug can be determined through /proc/cpuinfo.
Remove the notice and the surrounding logic to print it once.
Signed-off-by: Sohil Mehta <sohil.mehta@intel.com>
---
v3:
- Get rid of the notice instead of simplifying it. (Ahmed)
v2:
- New patch
---
arch/x86/kernel/cpu/intel.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
index e957c5a1501c..329ab1a90f5e 100644
--- a/arch/x86/kernel/cpu/intel.c
+++ b/arch/x86/kernel/cpu/intel.c
@@ -388,23 +388,15 @@ __setup("forcepae", forcepae_setup);
static void intel_workarounds(struct cpuinfo_x86 *c)
{
-#ifdef CONFIG_X86_F00F_BUG
/*
* All models of Pentium and Pentium with MMX technology CPUs
* have the F0 0F bug, which lets nonprivileged users lock up the
- * system. Announce that the fault handler will be checking for it.
+ * system. The fault handler always checks for it.
* The Quark is also family 5, but does not have the same bug.
*/
- if (c->x86_vfm >= INTEL_FAM5_START && c->x86_vfm < INTEL_QUARK_X1000) {
- static int f00f_workaround_enabled;
-
+ if ((IS_ENABLED(CONFIG_X86_F00F_BUG)) &&
+ (c->x86_vfm >= INTEL_FAM5_START && c->x86_vfm < INTEL_QUARK_X1000))
set_cpu_bug(c, X86_BUG_F00F);
- if (!f00f_workaround_enabled) {
- pr_notice("Intel Pentium with F0 0F bug - workaround enabled.\n");
- f00f_workaround_enabled = 1;
- }
- }
-#endif
/*
* SEP CPUID bug: Pentium Pro reports SEP but doesn't have it until
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 3/3] x86/cpufeature: Remove clear_cpu_bug()
2026-05-18 22:17 [PATCH v3 0/3] x86: Fix a F00F bug warning and cleanup surrounding code Sohil Mehta
2026-05-18 22:17 ` [PATCH v3 1/3] x86/cpu/intel: Don't clear X86_BUG_F00F before setting it Sohil Mehta
2026-05-18 22:17 ` [PATCH v3 2/3] x86/cpu/intel: Remove the F00F bug workaround notice Sohil Mehta
@ 2026-05-18 22:17 ` Sohil Mehta
2026-05-24 16:33 ` [PATCH v3 0/3] x86: Fix a F00F bug warning and cleanup surrounding code Borislav Petkov
3 siblings, 0 replies; 11+ messages in thread
From: Sohil Mehta @ 2026-05-18 22:17 UTC (permalink / raw)
To: Dave Hansen, Borislav Petkov, x86
Cc: Thomas Gleixner, Ingo Molnar, H . Peter Anvin, Josh Poimboeuf,
Richard Weinberger, Andrew Cooper, Tony Luck, Sohil Mehta,
Ahmed S . Darwish, linux-kernel
From: Richard Weinberger <richard@nod.at>
X86_BUG_F00F was the last remaining user of clear_cpu_bug(). With no
users left, remove this helper.
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sohil Mehta <sohil.mehta@intel.com>
Reviewed-by: Ahmed S. Darwish <darwi@linutronix.de>
---
v3:
- Picked up Ahmed's review tag.
v2:
- Improve commit message
---
arch/x86/include/asm/cpufeature.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
index 3ddc1d33399b..90680f978d43 100644
--- a/arch/x86/include/asm/cpufeature.h
+++ b/arch/x86/include/asm/cpufeature.h
@@ -125,7 +125,6 @@ static __always_inline bool _static_cpu_has(u16 bit)
#define cpu_has_bug(c, bit) cpu_has(c, (bit))
#define set_cpu_bug(c, bit) set_cpu_cap(c, (bit))
-#define clear_cpu_bug(c, bit) clear_cpu_cap(c, (bit))
#define static_cpu_has_bug(bit) static_cpu_has((bit))
#define boot_cpu_has_bug(bit) cpu_has_bug(&boot_cpu_data, (bit))
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/3] x86/cpu/intel: Remove the F00F bug workaround notice
2026-05-18 22:17 ` [PATCH v3 2/3] x86/cpu/intel: Remove the F00F bug workaround notice Sohil Mehta
@ 2026-05-19 9:00 ` Ahmed S. Darwish
0 siblings, 0 replies; 11+ messages in thread
From: Ahmed S. Darwish @ 2026-05-19 9:00 UTC (permalink / raw)
To: Sohil Mehta
Cc: Dave Hansen, Borislav Petkov, x86, Thomas Gleixner, Ingo Molnar,
H . Peter Anvin, Josh Poimboeuf, Richard Weinberger,
Andrew Cooper, Tony Luck, linux-kernel
On Mon, 18 May 2026, Sohil Mehta wrote:
>
> The F00F bug workaround announcement goes through a lot of effort to
> print the kernel notice exactly once. CPU bugs with workarounds
> typically don't require user notifications. If needed, the presence of
> the F00F bug can be determined through /proc/cpuinfo.
>
> Remove the notice and the surrounding logic to print it once.
>
> Signed-off-by: Sohil Mehta <sohil.mehta@intel.com>
> ---
Thanks for removing it.
Reviewed-by: Ahmed S. Darwish <darwi@linutronix.de>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 0/3] x86: Fix a F00F bug warning and cleanup surrounding code
2026-05-18 22:17 [PATCH v3 0/3] x86: Fix a F00F bug warning and cleanup surrounding code Sohil Mehta
` (2 preceding siblings ...)
2026-05-18 22:17 ` [PATCH v3 3/3] x86/cpufeature: Remove clear_cpu_bug() Sohil Mehta
@ 2026-05-24 16:33 ` Borislav Petkov
2026-05-27 6:44 ` Sohil Mehta
3 siblings, 1 reply; 11+ messages in thread
From: Borislav Petkov @ 2026-05-24 16:33 UTC (permalink / raw)
To: Sohil Mehta
Cc: Dave Hansen, x86, Thomas Gleixner, Ingo Molnar, H . Peter Anvin,
Josh Poimboeuf, Richard Weinberger, Andrew Cooper, Tony Luck,
Ahmed S . Darwish, linux-kernel
On Mon, May 18, 2026 at 03:17:15PM -0700, Sohil Mehta wrote:
> Changes in v3:
> - Remove the notice announcing the F00F bug workaround instead of
> simplifying it.
> - Pick up review tags from Ahmed.
>
> v2: https://lore.kernel.org/all/20260515002500.2463393-1-sohil.mehta@intel.com/
>
> Summary:
> The series fixes a harmless "alternatives_patched" warning that affects
> the original Pentium (Family 5) processors with SMP. It also removes the
> kernel announcement that the F00F bug workaround is in place. Mainly,
> the patches simplify and reduce lines of code.
>
> Original v1 post by Richard Weinberger:
> https://lore.kernel.org/lkml/20260216104343.3625292-1-richard@nod.at/
>
> The Fixes tag in patch 1 isn't strictly necessary. I left it inplace as
> Richard had it in his original series, but it can be removed to avoid
> backporting hassles.
>
> Richard Weinberger (2):
> x86/cpu/intel: Don't clear X86_BUG_F00F before setting it
> x86/cpufeature: Remove clear_cpu_bug()
>
> Sohil Mehta (1):
> x86/cpu/intel: Remove the F00F bug workaround notice
>
> arch/x86/include/asm/cpufeature.h | 1 -
> arch/x86/kernel/cpu/intel.c | 15 +++------------
> 2 files changed, 3 insertions(+), 13 deletions(-)
Why are there three patches doing one logical thing?
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 0/3] x86: Fix a F00F bug warning and cleanup surrounding code
2026-05-24 16:33 ` [PATCH v3 0/3] x86: Fix a F00F bug warning and cleanup surrounding code Borislav Petkov
@ 2026-05-27 6:44 ` Sohil Mehta
2026-05-27 18:06 ` Borislav Petkov
0 siblings, 1 reply; 11+ messages in thread
From: Sohil Mehta @ 2026-05-27 6:44 UTC (permalink / raw)
To: Borislav Petkov
Cc: Dave Hansen, x86, Thomas Gleixner, Ingo Molnar, H . Peter Anvin,
Josh Poimboeuf, Richard Weinberger, Andrew Cooper, Tony Luck,
Ahmed S . Darwish, linux-kernel
On 5/24/2026 9:33 AM, Borislav Petkov wrote:
>> The Fixes tag in patch 1 isn't strictly necessary. I left it inplace as
>> Richard had it in his original series, but it can be removed to avoid
>> backporting hassles.
>>
>> Richard Weinberger (2):
>> x86/cpu/intel: Don't clear X86_BUG_F00F before setting it
>> x86/cpufeature: Remove clear_cpu_bug()
>>
>> Sohil Mehta (1):
>> x86/cpu/intel: Remove the F00F bug workaround notice
>>
>> arch/x86/include/asm/cpufeature.h | 1 -
>> arch/x86/kernel/cpu/intel.c | 15 +++------------
>> 2 files changed, 3 insertions(+), 13 deletions(-)
>
> Why are there three patches doing one logical thing?
>
It's mainly because of the Fixes tag in patch 1. I didn't want to club
removing clear_cpu_bug() and removing the kernel notice with the fixup
patch. I wasn't sure if some stable kernel used clear_cpu_bug().
Would you prefer that I merge all three into a single one? Do you want
me to keep the Fixes tag in patch 1?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 0/3] x86: Fix a F00F bug warning and cleanup surrounding code
2026-05-27 6:44 ` Sohil Mehta
@ 2026-05-27 18:06 ` Borislav Petkov
2026-05-27 18:49 ` Sohil Mehta
0 siblings, 1 reply; 11+ messages in thread
From: Borislav Petkov @ 2026-05-27 18:06 UTC (permalink / raw)
To: Sohil Mehta
Cc: Dave Hansen, x86, Thomas Gleixner, Ingo Molnar, H . Peter Anvin,
Josh Poimboeuf, Richard Weinberger, Andrew Cooper, Tony Luck,
Ahmed S . Darwish, linux-kernel
On Tue, May 26, 2026 at 11:44:36PM -0700, Sohil Mehta wrote:
> It's mainly because of the Fixes tag in patch 1. I didn't want to club
> removing clear_cpu_bug() and removing the kernel notice with the fixup
> patch. I wasn't sure if some stable kernel used clear_cpu_bug().
>
> Would you prefer that I merge all three into a single one? Do you want
> me to keep the Fixes tag in patch 1?
Why would you even want to backport this to stable? Which of the stable rules
apply here and why are we making too much noise again about obsolete hw?
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 0/3] x86: Fix a F00F bug warning and cleanup surrounding code
2026-05-27 18:06 ` Borislav Petkov
@ 2026-05-27 18:49 ` Sohil Mehta
2026-05-27 18:51 ` Sohil Mehta
0 siblings, 1 reply; 11+ messages in thread
From: Sohil Mehta @ 2026-05-27 18:49 UTC (permalink / raw)
To: Borislav Petkov
Cc: Dave Hansen, x86, Thomas Gleixner, Ingo Molnar, H . Peter Anvin,
Josh Poimboeuf, Richard Weinberger, Andrew Cooper, Tony Luck,
Ahmed S . Darwish, linux-kernel
On 5/27/2026 11:06 AM, Borislav Petkov wrote:
> Why would you even want to backport this to stable? Which of the stable rules
> apply here and why are we making too much noise again about obsolete hw?
>
That's completely fine with me. My primary goal with this posting is to
simplify that section of code.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 0/3] x86: Fix a F00F bug warning and cleanup surrounding code
2026-05-27 18:49 ` Sohil Mehta
@ 2026-05-27 18:51 ` Sohil Mehta
2026-05-27 18:54 ` Richard Weinberger
0 siblings, 1 reply; 11+ messages in thread
From: Sohil Mehta @ 2026-05-27 18:51 UTC (permalink / raw)
To: Borislav Petkov
Cc: Dave Hansen, x86, Thomas Gleixner, Ingo Molnar, H . Peter Anvin,
Josh Poimboeuf, Richard Weinberger, Andrew Cooper, Tony Luck,
Ahmed S . Darwish, linux-kernel
(I pressed send too soon)
On 5/27/2026 11:49 AM, Sohil Mehta wrote:
> On 5/27/2026 11:06 AM, Borislav Petkov wrote:
>
>> Why would you even want to backport this to stable? Which of the stable rules
>> apply here and why are we making too much noise again about obsolete hw?
>>
>
> That's completely fine with me. My primary goal with this posting is to
> simplify that section of code.
I'll combine the patches into a single one and remove the fixes tag.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 0/3] x86: Fix a F00F bug warning and cleanup surrounding code
2026-05-27 18:51 ` Sohil Mehta
@ 2026-05-27 18:54 ` Richard Weinberger
0 siblings, 0 replies; 11+ messages in thread
From: Richard Weinberger @ 2026-05-27 18:54 UTC (permalink / raw)
To: Sohil Mehta
Cc: bp, dave hansen, x86, Thomas Gleixner, mingo, hpa, Josh Poimboeuf,
andrew cooper3, Tony Luck, Ahmed S. Darwish, linux-kernel
----- Ursprüngliche Mail -----
> Von: "Sohil Mehta" <sohil.mehta@intel.com>
> (I pressed send too soon)
>
> On 5/27/2026 11:49 AM, Sohil Mehta wrote:
>> On 5/27/2026 11:06 AM, Borislav Petkov wrote:
>>
>>> Why would you even want to backport this to stable? Which of the stable rules
>>> apply here and why are we making too much noise again about obsolete hw?
>>>
>>
>> That's completely fine with me. My primary goal with this posting is to
>> simplify that section of code.
>
> I'll combine the patches into a single one and remove the fixes tag.
Thanks for taking care of it!
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-05-27 18:54 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-18 22:17 [PATCH v3 0/3] x86: Fix a F00F bug warning and cleanup surrounding code Sohil Mehta
2026-05-18 22:17 ` [PATCH v3 1/3] x86/cpu/intel: Don't clear X86_BUG_F00F before setting it Sohil Mehta
2026-05-18 22:17 ` [PATCH v3 2/3] x86/cpu/intel: Remove the F00F bug workaround notice Sohil Mehta
2026-05-19 9:00 ` Ahmed S. Darwish
2026-05-18 22:17 ` [PATCH v3 3/3] x86/cpufeature: Remove clear_cpu_bug() Sohil Mehta
2026-05-24 16:33 ` [PATCH v3 0/3] x86: Fix a F00F bug warning and cleanup surrounding code Borislav Petkov
2026-05-27 6:44 ` Sohil Mehta
2026-05-27 18:06 ` Borislav Petkov
2026-05-27 18:49 ` Sohil Mehta
2026-05-27 18:51 ` Sohil Mehta
2026-05-27 18:54 ` Richard Weinberger
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.