.. | .. |
---|
106 | 106 | |
---|
107 | 107 | #define topology_logical_package_id(cpu) (cpu_data(cpu).logical_proc_id) |
---|
108 | 108 | #define topology_physical_package_id(cpu) (cpu_data(cpu).phys_proc_id) |
---|
| 109 | +#define topology_logical_die_id(cpu) (cpu_data(cpu).logical_die_id) |
---|
| 110 | +#define topology_die_id(cpu) (cpu_data(cpu).cpu_die_id) |
---|
109 | 111 | #define topology_core_id(cpu) (cpu_data(cpu).cpu_core_id) |
---|
110 | 112 | |
---|
| 113 | +extern unsigned int __max_die_per_package; |
---|
| 114 | + |
---|
111 | 115 | #ifdef CONFIG_SMP |
---|
| 116 | +#define topology_die_cpumask(cpu) (per_cpu(cpu_die_map, cpu)) |
---|
112 | 117 | #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu)) |
---|
113 | 118 | #define topology_sibling_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu)) |
---|
114 | 119 | |
---|
115 | 120 | extern unsigned int __max_logical_packages; |
---|
116 | 121 | #define topology_max_packages() (__max_logical_packages) |
---|
| 122 | + |
---|
| 123 | +static inline int topology_max_die_per_package(void) |
---|
| 124 | +{ |
---|
| 125 | + return __max_die_per_package; |
---|
| 126 | +} |
---|
117 | 127 | |
---|
118 | 128 | extern int __max_smt_threads; |
---|
119 | 129 | |
---|
.. | .. |
---|
123 | 133 | } |
---|
124 | 134 | |
---|
125 | 135 | int topology_update_package_map(unsigned int apicid, unsigned int cpu); |
---|
| 136 | +int topology_update_die_map(unsigned int dieid, unsigned int cpu); |
---|
126 | 137 | int topology_phys_to_logical_pkg(unsigned int pkg); |
---|
| 138 | +int topology_phys_to_logical_die(unsigned int die, unsigned int cpu); |
---|
127 | 139 | bool topology_is_primary_thread(unsigned int cpu); |
---|
128 | 140 | bool topology_smt_supported(void); |
---|
129 | 141 | #else |
---|
130 | 142 | #define topology_max_packages() (1) |
---|
131 | 143 | static inline int |
---|
132 | 144 | topology_update_package_map(unsigned int apicid, unsigned int cpu) { return 0; } |
---|
| 145 | +static inline int |
---|
| 146 | +topology_update_die_map(unsigned int dieid, unsigned int cpu) { return 0; } |
---|
133 | 147 | static inline int topology_phys_to_logical_pkg(unsigned int pkg) { return 0; } |
---|
| 148 | +static inline int topology_phys_to_logical_die(unsigned int die, |
---|
| 149 | + unsigned int cpu) { return 0; } |
---|
| 150 | +static inline int topology_max_die_per_package(void) { return 1; } |
---|
134 | 151 | static inline int topology_max_smt_threads(void) { return 1; } |
---|
135 | 152 | static inline bool topology_is_primary_thread(unsigned int cpu) { return true; } |
---|
136 | 153 | static inline bool topology_smt_supported(void) { return false; } |
---|
.. | .. |
---|
176 | 193 | } |
---|
177 | 194 | #endif /* CONFIG_SCHED_MC_PRIO */ |
---|
178 | 195 | |
---|
| 196 | +#if defined(CONFIG_SMP) && defined(CONFIG_X86_64) |
---|
| 197 | +#include <asm/cpufeature.h> |
---|
| 198 | + |
---|
| 199 | +DECLARE_STATIC_KEY_FALSE(arch_scale_freq_key); |
---|
| 200 | + |
---|
| 201 | +#define arch_scale_freq_invariant() static_branch_likely(&arch_scale_freq_key) |
---|
| 202 | + |
---|
| 203 | +DECLARE_PER_CPU(unsigned long, arch_freq_scale); |
---|
| 204 | + |
---|
| 205 | +static inline long arch_scale_freq_capacity(int cpu) |
---|
| 206 | +{ |
---|
| 207 | + return per_cpu(arch_freq_scale, cpu); |
---|
| 208 | +} |
---|
| 209 | +#define arch_scale_freq_capacity arch_scale_freq_capacity |
---|
| 210 | + |
---|
| 211 | +extern void arch_scale_freq_tick(void); |
---|
| 212 | +#define arch_scale_freq_tick arch_scale_freq_tick |
---|
| 213 | + |
---|
| 214 | +extern void arch_set_max_freq_ratio(bool turbo_disabled); |
---|
| 215 | +#else |
---|
| 216 | +static inline void arch_set_max_freq_ratio(bool turbo_disabled) |
---|
| 217 | +{ |
---|
| 218 | +} |
---|
| 219 | +#endif |
---|
| 220 | + |
---|
179 | 221 | #endif /* _ASM_X86_TOPOLOGY_H */ |
---|