^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef _ASM_X86_CPU_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define _ASM_X86_CPU_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #include <linux/device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #include <linux/cpu.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #include <linux/topology.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include <linux/nodemask.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <linux/percpu.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #ifdef CONFIG_SMP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) extern void prefill_possible_map(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #else /* CONFIG_SMP */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) static inline void prefill_possible_map(void) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #define cpu_physical_id(cpu) boot_cpu_physical_apicid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define cpu_acpi_id(cpu) 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define safe_smp_processor_id() 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #endif /* CONFIG_SMP */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) struct x86_cpu {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) struct cpu cpu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #ifdef CONFIG_HOTPLUG_CPU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) extern int arch_register_cpu(int num);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) extern void arch_unregister_cpu(int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) extern void start_cpu0(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #ifdef CONFIG_DEBUG_HOTPLUG_CPU0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) extern int _debug_hotplug_cpu(int cpu, int action);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) int mwait_usable(const struct cpuinfo_x86 *);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) unsigned int x86_family(unsigned int sig);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) unsigned int x86_model(unsigned int sig);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) unsigned int x86_stepping(unsigned int sig);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) #ifdef CONFIG_CPU_SUP_INTEL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) extern void __init cpu_set_core_cap_bits(struct cpuinfo_x86 *c);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) extern void switch_to_sld(unsigned long tifn);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) extern bool handle_user_split_lock(struct pt_regs *regs, long error_code);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) extern bool handle_guest_split_lock(unsigned long ip);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) static inline void __init cpu_set_core_cap_bits(struct cpuinfo_x86 *c) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) static inline void switch_to_sld(unsigned long tifn) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) static inline bool handle_user_split_lock(struct pt_regs *regs, long error_code)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) static inline bool handle_guest_split_lock(unsigned long ip)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) #ifdef CONFIG_IA32_FEAT_CTL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) void init_ia32_feat_ctl(struct cpuinfo_x86 *c);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) static inline void init_ia32_feat_ctl(struct cpuinfo_x86 *c) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) #endif /* _ASM_X86_CPU_H */