All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sohil Mehta <sohil.mehta@intel.com>
To: Dave Hansen <dave.hansen@linux.intel.com>,
	Borislav Petkov <bp@alien8.de>,
	x86@kernel.org
Cc: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	"H . Peter Anvin" <hpa@zytor.com>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	Richard Weinberger <richard@nod.at>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Tony Luck <tony.luck@intel.com>,
	Sohil Mehta <sohil.mehta@intel.com>,
	"Ahmed S . Darwish" <darwi@linutronix.de>,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2 1/3] x86/cpu/intel: Don't clear X86_BUG_F00F before setting it
Date: Thu, 14 May 2026 17:24:58 -0700	[thread overview]
Message-ID: <20260515002500.2463393-2-sohil.mehta@intel.com> (raw)
In-Reply-To: <20260515002500.2463393-1-sohil.mehta@intel.com>

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 CPU feature 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 commit message]
Signed-off-by: Sohil Mehta <sohil.mehta@intel.com>
---
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


  reply	other threads:[~2026-05-15  0:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-15  0:24 [PATCH v2 0/3] x86: Fix a F00F bug warning and cleanup surrounding code Sohil Mehta
2026-05-15  0:24 ` Sohil Mehta [this message]
2026-05-15 19:16   ` [PATCH v2 1/3] x86/cpu/intel: Don't clear X86_BUG_F00F before setting it Ahmed S. Darwish
2026-05-15  0:24 ` [PATCH v2 2/3] x86/cpu/intel: Simplify F00F bug notice using pr_notice_once() Sohil Mehta
2026-05-15 19:14   ` Ahmed S. Darwish
2026-05-15  0:25 ` [PATCH v2 3/3] x86/cpufeature: Remove clear_cpu_bug() Sohil Mehta
2026-05-15 19:16   ` Ahmed S. Darwish
2026-05-15  6:18 ` [PATCH v2 0/3] x86: Fix a F00F bug warning and cleanup surrounding code Richard Weinberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260515002500.2463393-2-sohil.mehta@intel.com \
    --to=sohil.mehta@intel.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bp@alien8.de \
    --cc=darwi@linutronix.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=richard@nod.at \
    --cc=tglx@kernel.org \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.