Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _ASM_X86_CPU_H
0003 #define _ASM_X86_CPU_H
0004 
0005 #include <linux/device.h>
0006 #include <linux/cpu.h>
0007 #include <linux/topology.h>
0008 #include <linux/nodemask.h>
0009 #include <linux/percpu.h>
0010 #include <asm/ibt.h>
0011 
0012 #ifdef CONFIG_SMP
0013 
0014 extern void prefill_possible_map(void);
0015 
0016 #else /* CONFIG_SMP */
0017 
0018 static inline void prefill_possible_map(void) {}
0019 
0020 #define cpu_physical_id(cpu)            boot_cpu_physical_apicid
0021 #define cpu_acpi_id(cpu)            0
0022 #define safe_smp_processor_id()         0
0023 
0024 #endif /* CONFIG_SMP */
0025 
0026 struct x86_cpu {
0027     struct cpu cpu;
0028 };
0029 
0030 #ifdef CONFIG_HOTPLUG_CPU
0031 extern int arch_register_cpu(int num);
0032 extern void arch_unregister_cpu(int);
0033 extern void start_cpu0(void);
0034 #ifdef CONFIG_DEBUG_HOTPLUG_CPU0
0035 extern int _debug_hotplug_cpu(int cpu, int action);
0036 #endif
0037 #endif
0038 
0039 extern void ap_init_aperfmperf(void);
0040 
0041 int mwait_usable(const struct cpuinfo_x86 *);
0042 
0043 unsigned int x86_family(unsigned int sig);
0044 unsigned int x86_model(unsigned int sig);
0045 unsigned int x86_stepping(unsigned int sig);
0046 #ifdef CONFIG_CPU_SUP_INTEL
0047 extern void __init sld_setup(struct cpuinfo_x86 *c);
0048 extern bool handle_user_split_lock(struct pt_regs *regs, long error_code);
0049 extern bool handle_guest_split_lock(unsigned long ip);
0050 extern void handle_bus_lock(struct pt_regs *regs);
0051 u8 get_this_hybrid_cpu_type(void);
0052 #else
0053 static inline void __init sld_setup(struct cpuinfo_x86 *c) {}
0054 static inline bool handle_user_split_lock(struct pt_regs *regs, long error_code)
0055 {
0056     return false;
0057 }
0058 
0059 static inline bool handle_guest_split_lock(unsigned long ip)
0060 {
0061     return false;
0062 }
0063 
0064 static inline void handle_bus_lock(struct pt_regs *regs) {}
0065 
0066 static inline u8 get_this_hybrid_cpu_type(void)
0067 {
0068     return 0;
0069 }
0070 #endif
0071 #ifdef CONFIG_IA32_FEAT_CTL
0072 void init_ia32_feat_ctl(struct cpuinfo_x86 *c);
0073 #else
0074 static inline void init_ia32_feat_ctl(struct cpuinfo_x86 *c) {}
0075 #endif
0076 
0077 extern __noendbr void cet_disable(void);
0078 
0079 struct ucode_cpu_info;
0080 
0081 int intel_cpu_collect_info(struct ucode_cpu_info *uci);
0082 
0083 static inline bool intel_cpu_signatures_match(unsigned int s1, unsigned int p1,
0084                           unsigned int s2, unsigned int p2)
0085 {
0086     if (s1 != s2)
0087         return false;
0088 
0089     /* Processor flags are either both 0 ... */
0090     if (!p1 && !p2)
0091         return true;
0092 
0093     /* ... or they intersect. */
0094     return p1 & p2;
0095 }
0096 
0097 #endif /* _ASM_X86_CPU_H */