x86: fix section mismatch warning - uv_cpu_init

WARNING: vmlinux.o(.cpuinit.text+0x3cc4): Section mismatch in reference from the function uv_cpu_init() to the function .init.text:uv_system_init()
The function __cpuinit uv_cpu_init() references
a function __init uv_system_init().
If uv_system_init is only used by uv_cpu_init then
annotate uv_system_init with a matching annotation.

uv_system_init was ment to be called only once, so do it from codepath
(native_smp_prepare_cpus) which is called once, right before activation
of other cpus (smp_init).

Note: old code relied on uv_node_to_blade being initialized to 0,
but it'a not initialized from anywhere.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Acked-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

authored by Marcin Slusarz and committed by Ingo Molnar c4bd1fda 3a6ddd5f

+10 -3
+5 -3
arch/x86/kernel/genx2apic_uv_x.c
··· 293 sn_rtc_cycles_per_second = ticks_per_sec; 294 } 295 296 - static __init void uv_system_init(void) 297 { 298 union uvh_si_addr_map_config_u m_n_config; 299 union uvh_node_id_u node_id; ··· 385 map_mmr_high(max_pnode); 386 map_config_high(max_pnode); 387 map_mmioh_high(max_pnode); 388 } 389 390 /* ··· 394 */ 395 void __cpuinit uv_cpu_init(void) 396 { 397 - if (!uv_node_to_blade) 398 - uv_system_init(); 399 400 uv_blade_info[uv_numa_blade_id()].nr_online_cpus++; 401
··· 293 sn_rtc_cycles_per_second = ticks_per_sec; 294 } 295 296 + static bool uv_system_inited; 297 + 298 + void __init uv_system_init(void) 299 { 300 union uvh_si_addr_map_config_u m_n_config; 301 union uvh_node_id_u node_id; ··· 383 map_mmr_high(max_pnode); 384 map_config_high(max_pnode); 385 map_mmioh_high(max_pnode); 386 + uv_system_inited = true; 387 } 388 389 /* ··· 391 */ 392 void __cpuinit uv_cpu_init(void) 393 { 394 + BUG_ON(!uv_system_inited); 395 396 uv_blade_info[uv_numa_blade_id()].nr_online_cpus++; 397
+3
arch/x86/kernel/smpboot.c
··· 1221 printk(KERN_INFO "CPU%d: ", 0); 1222 print_cpu_info(&cpu_data(0)); 1223 setup_boot_clock(); 1224 out: 1225 preempt_enable(); 1226 }
··· 1221 printk(KERN_INFO "CPU%d: ", 0); 1222 print_cpu_info(&cpu_data(0)); 1223 setup_boot_clock(); 1224 + 1225 + if (is_uv_system()) 1226 + uv_system_init(); 1227 out: 1228 preempt_enable(); 1229 }
+1
include/asm-x86/genapic_32.h
··· 118 #define get_uv_system_type() UV_NONE 119 #define is_uv_system() 0 120 #define uv_wakeup_secondary(a, b) 1 121 122 123 #endif
··· 118 #define get_uv_system_type() UV_NONE 119 #define is_uv_system() 0 120 #define uv_wakeup_secondary(a, b) 1 121 + #define uv_system_init() do {} while (0) 122 123 124 #endif
+1
include/asm-x86/genapic_64.h
··· 42 extern struct genapic apic_x2apic_uv_x; 43 DECLARE_PER_CPU(int, x2apic_extra_bits); 44 extern void uv_cpu_init(void); 45 extern int uv_wakeup_secondary(int phys_apicid, unsigned int start_rip); 46 47 extern void setup_apic_routing(void);
··· 42 extern struct genapic apic_x2apic_uv_x; 43 DECLARE_PER_CPU(int, x2apic_extra_bits); 44 extern void uv_cpu_init(void); 45 + extern void uv_system_init(void); 46 extern int uv_wakeup_secondary(int phys_apicid, unsigned int start_rip); 47 48 extern void setup_apic_routing(void);