v2
2026-08-15
x86 identify_cpu 重构与修复 · v2
重构 x86 identify_cpu() 机制,并修复 CPU 能力在可中断窗口被临时清除的问题。
原始补丁链接
子 Patch(5)
1/5
x86/cpu: Factor init_cpu_info() out of identify_cpu()
[x86/cpu: Factor init_cpu_info() out of identify_cpu()] identify_cpu() unconditionally resets the struct cpuinfo_x86 fields to their default values and clears the capability arrays with memset() befor
2/5
x86/cpu: Initialize boot CPU cpuinfo defaults early
[x86/cpu: Initialize boot CPU cpuinfo defaults early] early_identify_cpu() clears the capability array, the CPUID table and extended_cpuid_level, but the architectural defaults for the rest of struct
3/5
x86/cpu: Inline generic_identify() into identify_cpu()
[x86/cpu: Inline generic_identify() into identify_cpu()] generic_identify() has exactly one call site: at the top of identify_cpu(). Fold it into identify_cpu() so that a single function does the job
4/5
x86/cpu: Move 32-bit SEP setup into identify_cpu()
[x86/cpu: Move 32-bit SEP setup into identify_cpu()] identify_boot_cpu() and identify_secondary_cpu() both call enable_sep_cpu() under CONFIG_X86_32 immediately after identify_cpu(). Do it once and d
5/5
x86/cpu: Don't transiently clear the boot CPU's capabilities
[x86/cpu: Don’t transiently clear the boot CPU’s capabilities] On the boot CPU identify_cpu() runs from arch_cpu_finalize_init(), with interrupts enabled and before alternatives are patched. So cpu_fe