aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/smpboot.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/smpboot.c')
-rw-r--r--arch/x86/kernel/smpboot.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 2fecda69ee64..565ebc65920e 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -47,6 +47,7 @@
47#include <linux/bootmem.h> 47#include <linux/bootmem.h>
48#include <linux/err.h> 48#include <linux/err.h>
49#include <linux/nmi.h> 49#include <linux/nmi.h>
50#include <linux/tboot.h>
50 51
51#include <asm/acpi.h> 52#include <asm/acpi.h>
52#include <asm/desc.h> 53#include <asm/desc.h>
@@ -323,7 +324,7 @@ notrace static void __cpuinit start_secondary(void *unused)
323 /* enable local interrupts */ 324 /* enable local interrupts */
324 local_irq_enable(); 325 local_irq_enable();
325 326
326 setup_secondary_clock(); 327 x86_cpuinit.setup_percpu_clockev();
327 328
328 wmb(); 329 wmb();
329 cpu_idle(); 330 cpu_idle();
@@ -434,7 +435,8 @@ const struct cpumask *cpu_coregroup_mask(int cpu)
434 * For perf, we return last level cache shared map. 435 * For perf, we return last level cache shared map.
435 * And for power savings, we return cpu_core_map 436 * And for power savings, we return cpu_core_map
436 */ 437 */
437 if (sched_mc_power_savings || sched_smt_power_savings) 438 if ((sched_mc_power_savings || sched_smt_power_savings) &&
439 !(cpu_has(c, X86_FEATURE_AMD_DCM)))
438 return cpu_core_mask(cpu); 440 return cpu_core_mask(cpu);
439 else 441 else
440 return c->llc_shared_map; 442 return c->llc_shared_map;
@@ -1057,12 +1059,9 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
1057#endif 1059#endif
1058 current_thread_info()->cpu = 0; /* needed? */ 1060 current_thread_info()->cpu = 0; /* needed? */
1059 for_each_possible_cpu(i) { 1061 for_each_possible_cpu(i) {
1060 alloc_cpumask_var(&per_cpu(cpu_sibling_map, i), GFP_KERNEL); 1062 zalloc_cpumask_var(&per_cpu(cpu_sibling_map, i), GFP_KERNEL);
1061 alloc_cpumask_var(&per_cpu(cpu_core_map, i), GFP_KERNEL); 1063 zalloc_cpumask_var(&per_cpu(cpu_core_map, i), GFP_KERNEL);
1062 alloc_cpumask_var(&cpu_data(i).llc_shared_map, GFP_KERNEL); 1064 zalloc_cpumask_var(&cpu_data(i).llc_shared_map, GFP_KERNEL);
1063 cpumask_clear(per_cpu(cpu_core_map, i));
1064 cpumask_clear(per_cpu(cpu_sibling_map, i));
1065 cpumask_clear(cpu_data(i).llc_shared_map);
1066 } 1065 }
1067 set_cpu_sibling_map(0); 1066 set_cpu_sibling_map(0);
1068 1067
@@ -1112,13 +1111,26 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
1112 1111
1113 printk(KERN_INFO "CPU%d: ", 0); 1112 printk(KERN_INFO "CPU%d: ", 0);
1114 print_cpu_info(&cpu_data(0)); 1113 print_cpu_info(&cpu_data(0));
1115 setup_boot_clock(); 1114 x86_init.timers.setup_percpu_clockev();
1116 1115
1117 if (is_uv_system()) 1116 if (is_uv_system())
1118 uv_system_init(); 1117 uv_system_init();
1118
1119 set_mtrr_aps_delayed_init();
1119out: 1120out:
1120 preempt_enable(); 1121 preempt_enable();
1121} 1122}
1123
1124void arch_enable_nonboot_cpus_begin(void)
1125{
1126 set_mtrr_aps_delayed_init();
1127}
1128
1129void arch_enable_nonboot_cpus_end(void)
1130{
1131 mtrr_aps_init();
1132}
1133
1122/* 1134/*
1123 * Early setup to make printk work. 1135 * Early setup to make printk work.
1124 */ 1136 */
@@ -1140,6 +1152,7 @@ void __init native_smp_cpus_done(unsigned int max_cpus)
1140 setup_ioapic_dest(); 1152 setup_ioapic_dest();
1141#endif 1153#endif
1142 check_nmi_watchdog(); 1154 check_nmi_watchdog();
1155 mtrr_aps_init();
1143} 1156}
1144 1157
1145static int __initdata setup_possible_cpus = -1; 1158static int __initdata setup_possible_cpus = -1;
@@ -1317,6 +1330,7 @@ void play_dead_common(void)
1317void native_play_dead(void) 1330void native_play_dead(void)
1318{ 1331{
1319 play_dead_common(); 1332 play_dead_common();
1333 tboot_shutdown(TB_SHUTDOWN_WFS);
1320 wbinvd_halt(); 1334 wbinvd_halt();
1321} 1335}
1322 1336