x86: separate generic cpu disabling code from APIC writes in cpu_disable
It allows paravirt implementations of cpu_disable to share the cpu_disable_common code, without having to take on board APIC writes, which may not be appropriate. Signed-off-by: Alex Nixon <alex.nixon@citrix.com> Acked-by: Jeremy Fitzhardinge <jeremy@goop.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
@@ -1346,6 +1346,28 @@ static void __ref remove_cpu_from_maps(int cpu)
|
|||||||
numa_remove_cpu(cpu);
|
numa_remove_cpu(cpu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cpu_disable_common(void)
|
||||||
|
{
|
||||||
|
int cpu = smp_processor_id();
|
||||||
|
/*
|
||||||
|
* HACK:
|
||||||
|
* Allow any queued timer interrupts to get serviced
|
||||||
|
* This is only a temporary solution until we cleanup
|
||||||
|
* fixup_irqs as we do for IA64.
|
||||||
|
*/
|
||||||
|
local_irq_enable();
|
||||||
|
mdelay(1);
|
||||||
|
|
||||||
|
local_irq_disable();
|
||||||
|
remove_siblinginfo(cpu);
|
||||||
|
|
||||||
|
/* It's now safe to remove this processor from the online map */
|
||||||
|
lock_vector_lock();
|
||||||
|
remove_cpu_from_maps(cpu);
|
||||||
|
unlock_vector_lock();
|
||||||
|
fixup_irqs(cpu_online_map);
|
||||||
|
}
|
||||||
|
|
||||||
int native_cpu_disable(void)
|
int native_cpu_disable(void)
|
||||||
{
|
{
|
||||||
int cpu = smp_processor_id();
|
int cpu = smp_processor_id();
|
||||||
@@ -1365,23 +1387,7 @@ int native_cpu_disable(void)
|
|||||||
stop_apic_nmi_watchdog(NULL);
|
stop_apic_nmi_watchdog(NULL);
|
||||||
clear_local_APIC();
|
clear_local_APIC();
|
||||||
|
|
||||||
/*
|
cpu_disable_common();
|
||||||
* HACK:
|
|
||||||
* Allow any queued timer interrupts to get serviced
|
|
||||||
* This is only a temporary solution until we cleanup
|
|
||||||
* fixup_irqs as we do for IA64.
|
|
||||||
*/
|
|
||||||
local_irq_enable();
|
|
||||||
mdelay(1);
|
|
||||||
|
|
||||||
local_irq_disable();
|
|
||||||
remove_siblinginfo(cpu);
|
|
||||||
|
|
||||||
/* It's now safe to remove this processor from the online map */
|
|
||||||
lock_vector_lock();
|
|
||||||
remove_cpu_from_maps(cpu);
|
|
||||||
unlock_vector_lock();
|
|
||||||
fixup_irqs(cpu_online_map);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -125,6 +125,7 @@ static inline void arch_send_call_function_ipi(cpumask_t mask)
|
|||||||
smp_ops.send_call_func_ipi(mask);
|
smp_ops.send_call_func_ipi(mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cpu_disable_common(void);
|
||||||
void native_smp_prepare_boot_cpu(void);
|
void native_smp_prepare_boot_cpu(void);
|
||||||
void native_smp_prepare_cpus(unsigned int max_cpus);
|
void native_smp_prepare_cpus(unsigned int max_cpus);
|
||||||
void native_smp_cpus_done(unsigned int max_cpus);
|
void native_smp_cpus_done(unsigned int max_cpus);
|
||||||
|
Reference in New Issue
Block a user