diff options
| author | Ahmed S. Darwish <darwi@linutronix.de> | 2026-05-28 17:37:31 +0200 |
|---|---|---|
| committer | Borislav Petkov (AMD) <bp@alien8.de> | 2026-07-31 13:38:26 -0700 |
| commit | 21532edff7b08c9f9de743114375d635f95813f3 (patch) | |
| tree | 015d7f6ef583495beb24f7b47015a006224c6b31 /arch/x86/kernel/cpu | |
| parent | bec89bf9eacbfdcaead88e9a611215fcad3c5cf4 (diff) | |
x86/cpu: Use parsed CPUID(0x0)
Use parsed CPUID(0x0) instead of a direct CPUID query.
[ bp: Drop the unnecessary NULL check. ]
Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://patch.msgid.link/20260528153923.403473-10-darwi@linutronix.de
Diffstat (limited to 'arch/x86/kernel/cpu')
| -rw-r--r-- | arch/x86/kernel/cpu/common.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index b38126199a5b..e658f76a1b0f 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -942,11 +942,12 @@ void get_cpu_vendor(struct cpuinfo_x86 *c) void cpu_detect(struct cpuinfo_x86 *c) { - /* Get vendor name */ - cpuid(0x00000000, (unsigned int *)&c->cpuid_level, - (unsigned int *)&c->x86_vendor_id[0], - (unsigned int *)&c->x86_vendor_id[8], - (unsigned int *)&c->x86_vendor_id[4]); + const struct leaf_0x0_0 *l0 = cpuid_leaf(c, 0x0); + + c->cpuid_level = l0->max_std_leaf; + *(u32 *)&c->x86_vendor_id[0] = l0->cpu_vendorid_0; + *(u32 *)&c->x86_vendor_id[4] = l0->cpu_vendorid_1; + *(u32 *)&c->x86_vendor_id[8] = l0->cpu_vendorid_2; c->x86 = 4; /* Intel-defined flags: level 0x00000001 */ |
