diff options
Diffstat (limited to 'arch/x86/kernel/cpu/common.c')
| -rw-r--r-- | arch/x86/kernel/cpu/common.c | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 548bd039784e..25eb2747b063 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
| @@ -63,7 +63,7 @@ void __init setup_cpu_local_masks(void) | |||
| 63 | alloc_bootmem_cpumask_var(&cpu_sibling_setup_mask); | 63 | alloc_bootmem_cpumask_var(&cpu_sibling_setup_mask); |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | static void __cpuinit default_init(struct cpuinfo_x86 *c) | 66 | static void default_init(struct cpuinfo_x86 *c) |
| 67 | { | 67 | { |
| 68 | #ifdef CONFIG_X86_64 | 68 | #ifdef CONFIG_X86_64 |
| 69 | cpu_detect_cache_sizes(c); | 69 | cpu_detect_cache_sizes(c); |
| @@ -80,13 +80,13 @@ static void __cpuinit default_init(struct cpuinfo_x86 *c) | |||
| 80 | #endif | 80 | #endif |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | static const struct cpu_dev __cpuinitconst default_cpu = { | 83 | static const struct cpu_dev default_cpu = { |
| 84 | .c_init = default_init, | 84 | .c_init = default_init, |
| 85 | .c_vendor = "Unknown", | 85 | .c_vendor = "Unknown", |
| 86 | .c_x86_vendor = X86_VENDOR_UNKNOWN, | 86 | .c_x86_vendor = X86_VENDOR_UNKNOWN, |
| 87 | }; | 87 | }; |
| 88 | 88 | ||
| 89 | static const struct cpu_dev *this_cpu __cpuinitdata = &default_cpu; | 89 | static const struct cpu_dev *this_cpu = &default_cpu; |
| 90 | 90 | ||
| 91 | DEFINE_PER_CPU_PAGE_ALIGNED(struct gdt_page, gdt_page) = { .gdt = { | 91 | DEFINE_PER_CPU_PAGE_ALIGNED(struct gdt_page, gdt_page) = { .gdt = { |
| 92 | #ifdef CONFIG_X86_64 | 92 | #ifdef CONFIG_X86_64 |
| @@ -160,8 +160,8 @@ static int __init x86_xsaveopt_setup(char *s) | |||
| 160 | __setup("noxsaveopt", x86_xsaveopt_setup); | 160 | __setup("noxsaveopt", x86_xsaveopt_setup); |
| 161 | 161 | ||
| 162 | #ifdef CONFIG_X86_32 | 162 | #ifdef CONFIG_X86_32 |
| 163 | static int cachesize_override __cpuinitdata = -1; | 163 | static int cachesize_override = -1; |
| 164 | static int disable_x86_serial_nr __cpuinitdata = 1; | 164 | static int disable_x86_serial_nr = 1; |
| 165 | 165 | ||
| 166 | static int __init cachesize_setup(char *str) | 166 | static int __init cachesize_setup(char *str) |
| 167 | { | 167 | { |
| @@ -215,12 +215,12 @@ static inline int flag_is_changeable_p(u32 flag) | |||
| 215 | } | 215 | } |
| 216 | 216 | ||
| 217 | /* Probe for the CPUID instruction */ | 217 | /* Probe for the CPUID instruction */ |
| 218 | int __cpuinit have_cpuid_p(void) | 218 | int have_cpuid_p(void) |
| 219 | { | 219 | { |
| 220 | return flag_is_changeable_p(X86_EFLAGS_ID); | 220 | return flag_is_changeable_p(X86_EFLAGS_ID); |
| 221 | } | 221 | } |
| 222 | 222 | ||
| 223 | static void __cpuinit squash_the_stupid_serial_number(struct cpuinfo_x86 *c) | 223 | static void squash_the_stupid_serial_number(struct cpuinfo_x86 *c) |
| 224 | { | 224 | { |
| 225 | unsigned long lo, hi; | 225 | unsigned long lo, hi; |
| 226 | 226 | ||
| @@ -298,7 +298,7 @@ struct cpuid_dependent_feature { | |||
| 298 | u32 level; | 298 | u32 level; |
| 299 | }; | 299 | }; |
| 300 | 300 | ||
| 301 | static const struct cpuid_dependent_feature __cpuinitconst | 301 | static const struct cpuid_dependent_feature |
| 302 | cpuid_dependent_features[] = { | 302 | cpuid_dependent_features[] = { |
| 303 | { X86_FEATURE_MWAIT, 0x00000005 }, | 303 | { X86_FEATURE_MWAIT, 0x00000005 }, |
| 304 | { X86_FEATURE_DCA, 0x00000009 }, | 304 | { X86_FEATURE_DCA, 0x00000009 }, |
| @@ -306,7 +306,7 @@ cpuid_dependent_features[] = { | |||
| 306 | { 0, 0 } | 306 | { 0, 0 } |
| 307 | }; | 307 | }; |
| 308 | 308 | ||
| 309 | static void __cpuinit filter_cpuid_features(struct cpuinfo_x86 *c, bool warn) | 309 | static void filter_cpuid_features(struct cpuinfo_x86 *c, bool warn) |
| 310 | { | 310 | { |
| 311 | const struct cpuid_dependent_feature *df; | 311 | const struct cpuid_dependent_feature *df; |
| 312 | 312 | ||
| @@ -344,7 +344,7 @@ static void __cpuinit filter_cpuid_features(struct cpuinfo_x86 *c, bool warn) | |||
| 344 | */ | 344 | */ |
| 345 | 345 | ||
| 346 | /* Look up CPU names by table lookup. */ | 346 | /* Look up CPU names by table lookup. */ |
| 347 | static const char *__cpuinit table_lookup_model(struct cpuinfo_x86 *c) | 347 | static const char *table_lookup_model(struct cpuinfo_x86 *c) |
| 348 | { | 348 | { |
| 349 | const struct cpu_model_info *info; | 349 | const struct cpu_model_info *info; |
| 350 | 350 | ||
| @@ -364,8 +364,8 @@ static const char *__cpuinit table_lookup_model(struct cpuinfo_x86 *c) | |||
| 364 | return NULL; /* Not found */ | 364 | return NULL; /* Not found */ |
| 365 | } | 365 | } |
| 366 | 366 | ||
| 367 | __u32 cpu_caps_cleared[NCAPINTS] __cpuinitdata; | 367 | __u32 cpu_caps_cleared[NCAPINTS]; |
| 368 | __u32 cpu_caps_set[NCAPINTS] __cpuinitdata; | 368 | __u32 cpu_caps_set[NCAPINTS]; |
| 369 | 369 | ||
| 370 | void load_percpu_segment(int cpu) | 370 | void load_percpu_segment(int cpu) |
| 371 | { | 371 | { |
| @@ -394,9 +394,9 @@ void switch_to_new_gdt(int cpu) | |||
| 394 | load_percpu_segment(cpu); | 394 | load_percpu_segment(cpu); |
| 395 | } | 395 | } |
| 396 | 396 | ||
| 397 | static const struct cpu_dev *__cpuinitdata cpu_devs[X86_VENDOR_NUM] = {}; | 397 | static const struct cpu_dev *cpu_devs[X86_VENDOR_NUM] = {}; |
| 398 | 398 | ||
| 399 | static void __cpuinit get_model_name(struct cpuinfo_x86 *c) | 399 | static void get_model_name(struct cpuinfo_x86 *c) |
| 400 | { | 400 | { |
| 401 | unsigned int *v; | 401 | unsigned int *v; |
| 402 | char *p, *q; | 402 | char *p, *q; |
| @@ -425,7 +425,7 @@ static void __cpuinit get_model_name(struct cpuinfo_x86 *c) | |||
| 425 | } | 425 | } |
| 426 | } | 426 | } |
| 427 | 427 | ||
| 428 | void __cpuinit cpu_detect_cache_sizes(struct cpuinfo_x86 *c) | 428 | void cpu_detect_cache_sizes(struct cpuinfo_x86 *c) |
| 429 | { | 429 | { |
| 430 | unsigned int n, dummy, ebx, ecx, edx, l2size; | 430 | unsigned int n, dummy, ebx, ecx, edx, l2size; |
| 431 | 431 | ||
| @@ -479,7 +479,7 @@ u16 __read_mostly tlb_lld_4m[NR_INFO]; | |||
| 479 | */ | 479 | */ |
| 480 | s8 __read_mostly tlb_flushall_shift = -1; | 480 | s8 __read_mostly tlb_flushall_shift = -1; |
| 481 | 481 | ||
| 482 | void __cpuinit cpu_detect_tlb(struct cpuinfo_x86 *c) | 482 | void cpu_detect_tlb(struct cpuinfo_x86 *c) |
| 483 | { | 483 | { |
| 484 | if (this_cpu->c_detect_tlb) | 484 | if (this_cpu->c_detect_tlb) |
| 485 | this_cpu->c_detect_tlb(c); | 485 | this_cpu->c_detect_tlb(c); |
| @@ -493,7 +493,7 @@ void __cpuinit cpu_detect_tlb(struct cpuinfo_x86 *c) | |||
| 493 | tlb_flushall_shift); | 493 | tlb_flushall_shift); |
| 494 | } | 494 | } |
| 495 | 495 | ||
| 496 | void __cpuinit detect_ht(struct cpuinfo_x86 *c) | 496 | void detect_ht(struct cpuinfo_x86 *c) |
| 497 | { | 497 | { |
| 498 | #ifdef CONFIG_X86_HT | 498 | #ifdef CONFIG_X86_HT |
| 499 | u32 eax, ebx, ecx, edx; | 499 | u32 eax, ebx, ecx, edx; |
| @@ -544,7 +544,7 @@ out: | |||
| 544 | #endif | 544 | #endif |
| 545 | } | 545 | } |
| 546 | 546 | ||
| 547 | static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c) | 547 | static void get_cpu_vendor(struct cpuinfo_x86 *c) |
| 548 | { | 548 | { |
| 549 | char *v = c->x86_vendor_id; | 549 | char *v = c->x86_vendor_id; |
| 550 | int i; | 550 | int i; |
| @@ -571,7 +571,7 @@ static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c) | |||
| 571 | this_cpu = &default_cpu; | 571 | this_cpu = &default_cpu; |
| 572 | } | 572 | } |
| 573 | 573 | ||
| 574 | void __cpuinit cpu_detect(struct cpuinfo_x86 *c) | 574 | void cpu_detect(struct cpuinfo_x86 *c) |
| 575 | { | 575 | { |
| 576 | /* Get vendor name */ | 576 | /* Get vendor name */ |
| 577 | cpuid(0x00000000, (unsigned int *)&c->cpuid_level, | 577 | cpuid(0x00000000, (unsigned int *)&c->cpuid_level, |
| @@ -601,7 +601,7 @@ void __cpuinit cpu_detect(struct cpuinfo_x86 *c) | |||
| 601 | } | 601 | } |
| 602 | } | 602 | } |
| 603 | 603 | ||
| 604 | void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c) | 604 | void get_cpu_cap(struct cpuinfo_x86 *c) |
| 605 | { | 605 | { |
| 606 | u32 tfms, xlvl; | 606 | u32 tfms, xlvl; |
| 607 | u32 ebx; | 607 | u32 ebx; |
| @@ -652,7 +652,7 @@ void __cpuinit get_cpu_cap(struct cpuinfo_x86 *c) | |||
| 652 | init_scattered_cpuid_features(c); | 652 | init_scattered_cpuid_features(c); |
| 653 | } | 653 | } |
| 654 | 654 | ||
| 655 | static void __cpuinit identify_cpu_without_cpuid(struct cpuinfo_x86 *c) | 655 | static void identify_cpu_without_cpuid(struct cpuinfo_x86 *c) |
| 656 | { | 656 | { |
| 657 | #ifdef CONFIG_X86_32 | 657 | #ifdef CONFIG_X86_32 |
| 658 | int i; | 658 | int i; |
| @@ -769,7 +769,7 @@ void __init early_cpu_init(void) | |||
| 769 | * unless we can find a reliable way to detect all the broken cases. | 769 | * unless we can find a reliable way to detect all the broken cases. |
| 770 | * Enable it explicitly on 64-bit for non-constant inputs of cpu_has(). | 770 | * Enable it explicitly on 64-bit for non-constant inputs of cpu_has(). |
| 771 | */ | 771 | */ |
| 772 | static void __cpuinit detect_nopl(struct cpuinfo_x86 *c) | 772 | static void detect_nopl(struct cpuinfo_x86 *c) |
| 773 | { | 773 | { |
| 774 | #ifdef CONFIG_X86_32 | 774 | #ifdef CONFIG_X86_32 |
| 775 | clear_cpu_cap(c, X86_FEATURE_NOPL); | 775 | clear_cpu_cap(c, X86_FEATURE_NOPL); |
| @@ -778,7 +778,7 @@ static void __cpuinit detect_nopl(struct cpuinfo_x86 *c) | |||
| 778 | #endif | 778 | #endif |
| 779 | } | 779 | } |
| 780 | 780 | ||
| 781 | static void __cpuinit generic_identify(struct cpuinfo_x86 *c) | 781 | static void generic_identify(struct cpuinfo_x86 *c) |
| 782 | { | 782 | { |
| 783 | c->extended_cpuid_level = 0; | 783 | c->extended_cpuid_level = 0; |
| 784 | 784 | ||
| @@ -815,7 +815,7 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c) | |||
| 815 | /* | 815 | /* |
| 816 | * This does the hard work of actually picking apart the CPU stuff... | 816 | * This does the hard work of actually picking apart the CPU stuff... |
| 817 | */ | 817 | */ |
| 818 | static void __cpuinit identify_cpu(struct cpuinfo_x86 *c) | 818 | static void identify_cpu(struct cpuinfo_x86 *c) |
| 819 | { | 819 | { |
| 820 | int i; | 820 | int i; |
| 821 | 821 | ||
| @@ -960,7 +960,7 @@ void __init identify_boot_cpu(void) | |||
| 960 | cpu_detect_tlb(&boot_cpu_data); | 960 | cpu_detect_tlb(&boot_cpu_data); |
| 961 | } | 961 | } |
| 962 | 962 | ||
| 963 | void __cpuinit identify_secondary_cpu(struct cpuinfo_x86 *c) | 963 | void identify_secondary_cpu(struct cpuinfo_x86 *c) |
| 964 | { | 964 | { |
| 965 | BUG_ON(c == &boot_cpu_data); | 965 | BUG_ON(c == &boot_cpu_data); |
| 966 | identify_cpu(c); | 966 | identify_cpu(c); |
| @@ -975,14 +975,14 @@ struct msr_range { | |||
| 975 | unsigned max; | 975 | unsigned max; |
| 976 | }; | 976 | }; |
| 977 | 977 | ||
| 978 | static const struct msr_range msr_range_array[] __cpuinitconst = { | 978 | static const struct msr_range msr_range_array[] = { |
| 979 | { 0x00000000, 0x00000418}, | 979 | { 0x00000000, 0x00000418}, |
| 980 | { 0xc0000000, 0xc000040b}, | 980 | { 0xc0000000, 0xc000040b}, |
| 981 | { 0xc0010000, 0xc0010142}, | 981 | { 0xc0010000, 0xc0010142}, |
| 982 | { 0xc0011000, 0xc001103b}, | 982 | { 0xc0011000, 0xc001103b}, |
| 983 | }; | 983 | }; |
| 984 | 984 | ||
| 985 | static void __cpuinit __print_cpu_msr(void) | 985 | static void __print_cpu_msr(void) |
| 986 | { | 986 | { |
| 987 | unsigned index_min, index_max; | 987 | unsigned index_min, index_max; |
| 988 | unsigned index; | 988 | unsigned index; |
| @@ -1001,7 +1001,7 @@ static void __cpuinit __print_cpu_msr(void) | |||
| 1001 | } | 1001 | } |
| 1002 | } | 1002 | } |
| 1003 | 1003 | ||
| 1004 | static int show_msr __cpuinitdata; | 1004 | static int show_msr; |
| 1005 | 1005 | ||
| 1006 | static __init int setup_show_msr(char *arg) | 1006 | static __init int setup_show_msr(char *arg) |
| 1007 | { | 1007 | { |
| @@ -1022,7 +1022,7 @@ static __init int setup_noclflush(char *arg) | |||
| 1022 | } | 1022 | } |
| 1023 | __setup("noclflush", setup_noclflush); | 1023 | __setup("noclflush", setup_noclflush); |
| 1024 | 1024 | ||
| 1025 | void __cpuinit print_cpu_info(struct cpuinfo_x86 *c) | 1025 | void print_cpu_info(struct cpuinfo_x86 *c) |
| 1026 | { | 1026 | { |
| 1027 | const char *vendor = NULL; | 1027 | const char *vendor = NULL; |
| 1028 | 1028 | ||
| @@ -1051,7 +1051,7 @@ void __cpuinit print_cpu_info(struct cpuinfo_x86 *c) | |||
| 1051 | print_cpu_msr(c); | 1051 | print_cpu_msr(c); |
| 1052 | } | 1052 | } |
| 1053 | 1053 | ||
| 1054 | void __cpuinit print_cpu_msr(struct cpuinfo_x86 *c) | 1054 | void print_cpu_msr(struct cpuinfo_x86 *c) |
| 1055 | { | 1055 | { |
| 1056 | if (c->cpu_index < show_msr) | 1056 | if (c->cpu_index < show_msr) |
| 1057 | __print_cpu_msr(); | 1057 | __print_cpu_msr(); |
| @@ -1216,7 +1216,7 @@ static void dbg_restore_debug_regs(void) | |||
| 1216 | */ | 1216 | */ |
| 1217 | #ifdef CONFIG_X86_64 | 1217 | #ifdef CONFIG_X86_64 |
| 1218 | 1218 | ||
| 1219 | void __cpuinit cpu_init(void) | 1219 | void cpu_init(void) |
| 1220 | { | 1220 | { |
| 1221 | struct orig_ist *oist; | 1221 | struct orig_ist *oist; |
| 1222 | struct task_struct *me; | 1222 | struct task_struct *me; |
| @@ -1315,7 +1315,7 @@ void __cpuinit cpu_init(void) | |||
| 1315 | 1315 | ||
| 1316 | #else | 1316 | #else |
| 1317 | 1317 | ||
| 1318 | void __cpuinit cpu_init(void) | 1318 | void cpu_init(void) |
| 1319 | { | 1319 | { |
| 1320 | int cpu = smp_processor_id(); | 1320 | int cpu = smp_processor_id(); |
| 1321 | struct task_struct *curr = current; | 1321 | struct task_struct *curr = current; |
