From: Dave Hansen <dave.hansen@linux.intel.com>
To: linux-kernel@vger.kernel.org
Cc: x86@kernel.org,tglx@linutronix.de,bp@alien8.de,kan.liang@linux.intel.com,Dave
Hansen <dave.hansen@linux.intel.com>
Subject: [v2][PATCH 5/5] x86/cpu: Remove 'x86_cpu_desc' infrastructure
Date: Fri, 13 Dec 2024 10:51:33 -0800 [thread overview]
Message-ID: <20241213185133.AF0BF2BC@davehans-spike.ostc.intel.com> (raw)
In-Reply-To: <20241213185127.F38B6EE9@davehans-spike.ostc.intel.com>
From: Dave Hansen <dave.hansen@linux.intel.com>
All the users of 'x86_cpu_desc' are gone. Zap it from the tree.
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
---
b/arch/x86/include/asm/cpu_device_id.h | 35 ---------------------------------
b/arch/x86/kernel/cpu/match.c | 31 -----------------------------
2 files changed, 66 deletions(-)
diff -puN arch/x86/include/asm/cpu_device_id.h~zap-x86_cpu_desc-3 arch/x86/include/asm/cpu_device_id.h
--- a/arch/x86/include/asm/cpu_device_id.h~zap-x86_cpu_desc-3 2024-12-13 10:48:03.174376959 -0800
+++ b/arch/x86/include/asm/cpu_device_id.h 2024-12-13 10:48:03.178377120 -0800
@@ -243,42 +243,7 @@
VFM_MODEL(vfm), \
X86_STEPPING_ANY, feature, data)
-/*
- * Match specific microcode revisions.
- *
- * vendor/family/model/stepping must be all set.
- *
- * Only checks against the boot CPU. When mixed-stepping configs are
- * valid for a CPU model, add a quirk for every valid stepping and
- * do the fine-tuning in the quirk handler.
- */
-
-struct x86_cpu_desc {
- u8 x86_family;
- u8 x86_vendor;
- u8 x86_model;
- u8 x86_stepping;
- u32 x86_microcode_rev;
-};
-
-#define INTEL_CPU_DESC(vfm, stepping, revision) { \
- .x86_family = VFM_FAMILY(vfm), \
- .x86_vendor = VFM_VENDOR(vfm), \
- .x86_model = VFM_MODEL(vfm), \
- .x86_stepping = (stepping), \
- .x86_microcode_rev = (revision), \
-}
-
-#define AMD_CPU_DESC(fam, model, stepping, revision) { \
- .x86_family = (fam), \
- .x86_vendor = X86_VENDOR_AMD, \
- .x86_model = (model), \
- .x86_stepping = (stepping), \
- .x86_microcode_rev = (revision), \
-}
-
extern const struct x86_cpu_id *x86_match_cpu(const struct x86_cpu_id *match);
-extern bool x86_cpu_has_min_microcode_rev(const struct x86_cpu_desc *table);
extern bool x86_match_min_microcode_rev(const struct x86_cpu_id *table);
#endif /* _ASM_X86_CPU_DEVICE_ID */
diff -puN arch/x86/kernel/cpu/match.c~zap-x86_cpu_desc-3 arch/x86/kernel/cpu/match.c
--- a/arch/x86/kernel/cpu/match.c~zap-x86_cpu_desc-3 2024-12-13 10:48:03.174376959 -0800
+++ b/arch/x86/kernel/cpu/match.c 2024-12-13 10:48:03.178377120 -0800
@@ -56,37 +56,6 @@ const struct x86_cpu_id *x86_match_cpu(c
}
EXPORT_SYMBOL(x86_match_cpu);
-static const struct x86_cpu_desc *
-x86_match_cpu_with_stepping(const struct x86_cpu_desc *match)
-{
- struct cpuinfo_x86 *c = &boot_cpu_data;
- const struct x86_cpu_desc *m;
-
- for (m = match; m->x86_family | m->x86_model; m++) {
- if (c->x86_vendor != m->x86_vendor)
- continue;
- if (c->x86 != m->x86_family)
- continue;
- if (c->x86_model != m->x86_model)
- continue;
- if (c->x86_stepping != m->x86_stepping)
- continue;
- return m;
- }
- return NULL;
-}
-
-bool x86_cpu_has_min_microcode_rev(const struct x86_cpu_desc *table)
-{
- const struct x86_cpu_desc *res = x86_match_cpu_with_stepping(table);
-
- if (!res || res->x86_microcode_rev > boot_cpu_data.microcode)
- return false;
-
- return true;
-}
-EXPORT_SYMBOL_GPL(x86_cpu_has_min_microcode_rev);
-
bool x86_match_min_microcode_rev(const struct x86_cpu_id *table)
{
const struct x86_cpu_id *res = x86_match_cpu(table);
_
prev parent reply other threads:[~2024-12-13 18:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-13 18:51 [v2][PATCH 0/5] x86/cpu: Remove duplicate microcode version matching infrastructure Dave Hansen
2024-12-13 18:51 ` [v2][PATCH 1/5] x86/cpu: Introduce new microcode matching helper Dave Hansen
2024-12-13 18:51 ` [v2][PATCH 2/5] x86/cpu: Expose only stepping min/max interface Dave Hansen
2024-12-13 18:51 ` [v2][PATCH 3/5] x86/cpu: Replace PEBS use of 'x86_cpu_desc' use with 'x86_cpu_id' Dave Hansen
2024-12-13 18:51 ` [v2][PATCH 4/5] x86/cpu: Move AMD erratum 1386 table over to 'x86_cpu_id' Dave Hansen
2025-04-09 11:13 ` Jiri Slaby
2025-04-09 15:18 ` Borislav Petkov
2025-04-09 15:21 ` Dave Hansen
2025-04-09 15:45 ` Jiri Slaby
2024-12-13 18:51 ` Dave Hansen [this message]
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=20241213185133.AF0BF2BC@davehans-spike.ostc.intel.com \
--to=dave.hansen@linux.intel.com \
--cc=bp@alien8.de \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--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