patches.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Tony Luck <tony.luck@intel.com>
To: x86@kernel.org
Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev,
	Tony Luck <tony.luck@intel.com>
Subject: [PATCH] x86/cpu: Fix x86_match_cpu() to match just X86_VENDOR_INTEL
Date: Wed, 15 May 2024 14:43:57 -0700	[thread overview]
Message-ID: <20240515214357.73798-1-tony.luck@intel.com> (raw)

There's a wildcard match in arch/x86/kernel/smpboot.c that wants
to hit on any CPU made by Intel. The match used to work because
the check was actually looking for any Intel CPU in family 6.

With the change to ease support for families other than 6,
this wildcard match failed because every entry in the struct x86_cpu_id
was zero. This is used as the end-marker in arrays of x86_cpu_id
structures, so can never match.

Failure to match meant the logic to detect Intel Sub-NUMA cluster
mode didn't operate and there were boot messages about insane
cache configuration.

Fix by changing X86_VENDOR_INTEL to a non-zero value (4 was lowest
unused value, so I picked that).

Fixes: 4db64279bc2b ("x86/cpu: Switch to new Intel CPU model defines")
Signed-off-by: Tony Luck <tony.luck@intel.com>
---
 arch/x86/include/asm/processor.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index cb4f6c513c48..271c4c95bc37 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -175,10 +175,10 @@ struct cpuinfo_x86 {
 	unsigned		initialized : 1;
 } __randomize_layout;
 
-#define X86_VENDOR_INTEL	0
 #define X86_VENDOR_CYRIX	1
 #define X86_VENDOR_AMD		2
 #define X86_VENDOR_UMC		3
+#define X86_VENDOR_INTEL	4
 #define X86_VENDOR_CENTAUR	5
 #define X86_VENDOR_TRANSMETA	7
 #define X86_VENDOR_NSC		8
-- 
2.44.0


             reply	other threads:[~2024-05-15 21:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-15 21:43 Tony Luck [this message]
2024-05-15 22:00 ` [PATCH] x86/cpu: Fix x86_match_cpu() to match just X86_VENDOR_INTEL Borislav Petkov
2024-05-15 22:07   ` Luck, Tony
2024-05-16  7:17     ` Borislav Petkov

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=20240515214357.73798-1-tony.luck@intel.com \
    --to=tony.luck@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@lists.linux.dev \
    --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 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 read-only IMAP folder(s) and NNTP newsgroup(s).