* stopping APs during shutdown/reboot
@ 2007-04-11 7:37 Cihula, Joseph
2007-04-11 7:42 ` Keir Fraser
0 siblings, 1 reply; 2+ messages in thread
From: Cihula, Joseph @ 2007-04-11 7:37 UTC (permalink / raw)
To: xen-devel
machine_halt(), in xen/arch/x86/shutdown.c, uses
smp_call_function(__machine_halt, NULL, 1, 0) to stop all APs.
__machine_halt() is just an infinite for loop of __asm__ __volatile__ (
"hlt" );
machine_restart(), also in shudown.c, uses smp_send_stop() which ends up
doing the same thing with a few additional cleanup procedures.
Other than the fact that smp_send_stop() does a few extra cleanup steps
that aren't strictly necessary (but shouldn't be harmful) if the system
is really going to be shutdown (as opposed to restarted), is there any
reason that these two fns that both need to halt APs shouldn't use the
same code--i.e. smp_send_stop()? IMHO, the more shared shutdown code
and common paths the better.
Also, in machine_restart() there is the following:
...
/* Ensure we are the boot CPU. */
if ( GET_APIC_ID(apic_read(APIC_ID)) != boot_cpu_physical_apicid )
{
/* Send IPI to the boot CPU (logical cpu 0). */
on_selected_cpus(cpumask_of_cpu(0), (void *)machine_restart,
NULL, 1, 0);
for ( ; ; )
safe_halt();
}
/*
* Stop all CPUs and turn off local APICs and the IO-APIC, so
* other OSs see a clean IRQ state.
*/
smp_send_stop();
...
If this fn is entered on an AP, it appears that the AP will just do a
safe_halt(), which does not do some cleanup steps (e.g. hvm_disable()).
However, if it is entered on the BSP then it will use smp_send_stop() to
halt the APs and they will all go through these cleanup steps (incl.
hvm_disable()). Shouldn't the APs all be put into the same state
regardless of whether machine_restart() was called on an AP or BSP?
Joe
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: stopping APs during shutdown/reboot
2007-04-11 7:37 stopping APs during shutdown/reboot Cihula, Joseph
@ 2007-04-11 7:42 ` Keir Fraser
0 siblings, 0 replies; 2+ messages in thread
From: Keir Fraser @ 2007-04-11 7:42 UTC (permalink / raw)
To: Cihula, Joseph, xen-devel
On 11/4/07 08:37, "Cihula, Joseph" <joseph.cihula@intel.com> wrote:
> machine_halt(), in xen/arch/x86/shutdown.c, uses
> smp_call_function(__machine_halt, NULL, 1, 0) to stop all APs.
> __machine_halt() is just an infinite for loop of __asm__ __volatile__ (
> "hlt" );
>
> machine_restart(), also in shudown.c, uses smp_send_stop() which ends up
> doing the same thing with a few additional cleanup procedures.
Yes, shutdown is a fricking mess, especially after the kexec changes.
There's a fair bit of scope for cleanup.
-- Keir
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-04-11 7:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-11 7:37 stopping APs during shutdown/reboot Cihula, Joseph
2007-04-11 7:42 ` Keir Fraser
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.