1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _ASM_X86_CPU_H
3#define _ASM_X86_CPU_H
4
5#include <linux/device.h>
6#include <linux/cpu.h>
7#include <linux/topology.h>
8#include <linux/nodemask.h>
9#include <linux/percpu.h>
10#include <asm/ibt.h>
11
12#ifdef CONFIG_SMP
13
14extern void prefill_possible_map(void);
15
16#else /* CONFIG_SMP */
17
18static inline void prefill_possible_map(void) {}
19
20#define cpu_physical_id(cpu) boot_cpu_physical_apicid
21#define cpu_acpi_id(cpu) 0
22#define safe_smp_processor_id() 0
23
24#endif /* CONFIG_SMP */
25
26struct x86_cpu {
27 struct cpu cpu;
28};
29
30#ifdef CONFIG_HOTPLUG_CPU
31extern void soft_restart_cpu(void);
32#endif
33
34extern void ap_init_aperfmperf(void);
35
36int mwait_usable(const struct cpuinfo_x86 *);
37
38unsigned int x86_family(unsigned int sig);
39unsigned int x86_model(unsigned int sig);
40unsigned int x86_stepping(unsigned int sig);
41#ifdef CONFIG_CPU_SUP_INTEL
42extern void __init sld_setup(struct cpuinfo_x86 *c);
43extern bool handle_user_split_lock(struct pt_regs *regs, long error_code);
44extern bool handle_guest_split_lock(unsigned long ip);
45extern void handle_bus_lock(struct pt_regs *regs);
46u8 get_this_hybrid_cpu_type(void);
47#else
48static inline void __init sld_setup(struct cpuinfo_x86 *c) {}
49static inline bool handle_user_split_lock(struct pt_regs *regs, long error_code)
50{
51 return false;
52}
53
54static inline bool handle_guest_split_lock(unsigned long ip)
55{
56 return false;
57}
58
59static inline void handle_bus_lock(struct pt_regs *regs) {}
60
61static inline u8 get_this_hybrid_cpu_type(void)
62{
63 return 0;
64}
65#endif
66#ifdef CONFIG_IA32_FEAT_CTL
67void init_ia32_feat_ctl(struct cpuinfo_x86 *c);
68#else
69static inline void init_ia32_feat_ctl(struct cpuinfo_x86 *c) {}
70#endif
71
72extern __noendbr void cet_disable(void);
73
74struct cpu_signature;
75
76void intel_collect_cpu_info(struct cpu_signature *sig);
77
78extern u64 x86_read_arch_cap_msr(void);
79bool intel_find_matching_signature(void *mc, struct cpu_signature *sig);
80int intel_microcode_sanity_check(void *mc, bool print_err, int hdr_type);
81
82extern struct cpumask cpus_stop_mask;
83
84#endif /* _ASM_X86_CPU_H */
85

source code of linux/arch/x86/include/asm/cpu.h