diff options
| author | Ingo Molnar <mingo@kernel.org> | 2026-07-28 10:09:41 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2026-07-28 10:09:41 +0200 |
| commit | 4592a0ffbe5ec28f1600bfddae766eadbc134b92 (patch) | |
| tree | 8584eb7407e79e104e8477d938fe226b694bcbfb /arch/x86/kernel/cpu | |
| parent | d64c69eb8d8938a593a6acaa32489393319f132e (diff) | |
| parent | 10b45e63a5b010be59ecbd2e437744adb12f838a (diff) | |
| download | linux-next-4592a0ffbe5ec28f1600bfddae766eadbc134b92.tar.gz linux-next-4592a0ffbe5ec28f1600bfddae766eadbc134b92.zip | |
Merge branch into tip/master: 'x86/cleanups'
# New commits in x86/cleanups:
10b45e63a5b0 ("x86/cpu: Remove unnecessary __maybe_unused annotations")
b096d79bc1ee ("x86/msr: Document the I/O-like write semantics in the msr driver")
cdb4d57c3e49 ("x86/apic: Ensure ICR register write value is handled as 32 bits")
7bdcb5b3a9c5 ("x86/boot/compressed/head_64.S: Clean up SEV-related comments")
db55777feca8 ("Documentation/arch/x86/amd-memory-encryption.rst: Fix typo")
edeed06c2ba0 ("x86/platform/quark: Fix kernel-doc warnings in imr.c")
c8e412f79db6 ("x86/ras: Move contents from arch/x86/ras/Kconfig into drivers/ras/Kconfig")
77d34d395093 ("x86/cpu: Move intel_get_platform_id() to cpu/intel.c")
324549c06ead ("x86/mm: Fix typo in comment")
b47748678c6c ("x86/fpu: Fix kernel-doc formatting above fpu_enable_guest_xfd_features()")
0cfdf974f133 ("x86/cfi: Use symmetric SYM_START and SYM_END in __CFI_TYPE()")
bed18bbbf9d9 ("x86/cfi: Add __init_or_module annotations for fineibt")
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/cpu')
| -rw-r--r-- | arch/x86/kernel/cpu/common.c | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/intel.c | 35 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/microcode/amd.c | 3 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/microcode/intel.c | 36 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/topology_common.c | 2 |
5 files changed, 38 insertions, 40 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index d696da7387b3..e84ddf6bb10d 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -1660,7 +1660,7 @@ static inline bool parse_set_clear_cpuid(char *arg, bool set) int taint = 0; while (arg) { - bool found __maybe_unused = false; + bool found = false; unsigned int bit; opt = strsep(&arg, ","); diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index 076bdd0d3f85..4297ceb2cb24 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c @@ -199,6 +199,41 @@ void intel_unlock_cpuid_leafs(struct cpuinfo_x86 *c) c->cpuid_level = cpuid_eax(0); } +/* + * Use CPUID to generate a "vfm" value. Useful before cpuinfo_x86 + * structures are populated. + */ +static u32 intel_cpuid_vfm(void) +{ + u32 eax = cpuid_eax(1); + u32 fam = x86_family(eax); + u32 model = x86_model(eax); + + return IFM(fam, model); +} + +u32 intel_get_platform_id(void) +{ + unsigned int val[2]; + + if (x86_hypervisor_present) + return 0; + + /* + * This can be called early. Use CPUID directly instead of + * relying on cpuinfo_x86 which may not be fully initialized. + * The PII does not have MSR_IA32_PLATFORM_ID. Everything + * before _it_ has no microcode (for Linux at least). + */ + if (intel_cpuid_vfm() <= INTEL_PENTIUM_II_KLAMATH) + return 0; + + /* get processor flags from MSR 0x17 */ + native_rdmsr(MSR_IA32_PLATFORM_ID, val[0], val[1]); + + return (val[1] >> 18) & 7; +} + static void early_init_intel(struct cpuinfo_x86 *c) { u64 misc_enable; diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c index 531dfb771c8b..6cdc410e7547 100644 --- a/arch/x86/kernel/cpu/microcode/amd.c +++ b/arch/x86/kernel/cpu/microcode/amd.c @@ -136,8 +136,7 @@ struct cont_desc { * Microcode patch container file is prepended to the initrd in cpio * format. See Documentation/arch/x86/microcode.rst */ -static const char -ucode_path[] __maybe_unused = "kernel/x86/microcode/AuthenticAMD.bin"; +static const char ucode_path[] = "kernel/x86/microcode/AuthenticAMD.bin"; /* * This is CPUID(1).EAX on the BSP. It is used in two ways: diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c index f4a444e6114d..1142183c950c 100644 --- a/arch/x86/kernel/cpu/microcode/intel.c +++ b/arch/x86/kernel/cpu/microcode/intel.c @@ -121,42 +121,6 @@ static inline unsigned int exttable_size(struct extended_sigtable *et) return et->count * EXT_SIGNATURE_SIZE + EXT_HEADER_SIZE; } - -/* - * Use CPUID to generate a "vfm" value. Useful before cpuinfo_x86 - * structures are populated. - */ -static u32 intel_cpuid_vfm(void) -{ - u32 eax = cpuid_eax(1); - u32 fam = x86_family(eax); - u32 model = x86_model(eax); - - return IFM(fam, model); -} - -u32 intel_get_platform_id(void) -{ - unsigned int val[2]; - - if (x86_hypervisor_present) - return 0; - - /* - * This can be called early. Use CPUID directly instead of - * relying on cpuinfo_x86 which may not be fully initialized. - * The PII does not have MSR_IA32_PLATFORM_ID. Everything - * before _it_ has no microcode (for Linux at least). - */ - if (intel_cpuid_vfm() <= INTEL_PENTIUM_II_KLAMATH) - return 0; - - /* get processor flags from MSR 0x17 */ - native_rdmsr(MSR_IA32_PLATFORM_ID, val[0], val[1]); - - return (val[1] >> 18) & 7; -} - void intel_collect_cpu_info(struct cpu_signature *sig) { sig->sig = cpuid_eax(1); diff --git a/arch/x86/kernel/cpu/topology_common.c b/arch/x86/kernel/cpu/topology_common.c index 581f2fcd7e42..6845e3c63fbb 100644 --- a/arch/x86/kernel/cpu/topology_common.c +++ b/arch/x86/kernel/cpu/topology_common.c @@ -65,7 +65,7 @@ const char *get_topology_cpu_type_name(struct cpuinfo_x86 *c) } } -static unsigned int __maybe_unused parse_num_cores_legacy(struct cpuinfo_x86 *c) +static unsigned int parse_num_cores_legacy(struct cpuinfo_x86 *c) { struct { u32 cache_type : 5, |
