[PATCH v7 048/120] x86/mce: core: Use parsed CPUID(0x1)

From: Ahmed S. Darwish

Date: Thu May 28 2026 - 12:09:39 EST


For MCE record preparation, use parsed CPUID(0x1) instead of a direct CPUID
query.

Keep storing the raw EAX output into struct mce. As documented within
__print_mce(), the raw value is parsed by external tools.

Signed-off-by: Ahmed S. Darwish <darwi@xxxxxxxxxxxxx>
---
arch/x86/kernel/cpu/mce/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index eebc60342cd6..821cac467c9f 100644
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -120,7 +120,7 @@ BLOCKING_NOTIFIER_HEAD(x86_mce_decoder_chain);

void mce_prep_record_common(struct mce *m)
{
- m->cpuid = cpuid_eax(1);
+ m->cpuid = cpuid_leaf_raw(&boot_cpu_data, 0x1)->eax;
m->cpuvendor = boot_cpu_data.x86_vendor;
m->mcgcap = native_rdmsrq(MSR_IA32_MCG_CAP);
/* need the internal __ version to avoid deadlocks */
--
2.54.0