WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] stopping APs during shutdown/reboot

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] stopping APs during shutdown/reboot
From: "Cihula, Joseph" <joseph.cihula@xxxxxxxxx>
Date: Wed, 11 Apr 2007 00:37:24 -0700
Delivery-date: Wed, 11 Apr 2007 00:36:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acd8DD95WrzbOHQpQH2y9vGywbxRhQ==
Thread-topic: stopping APs during shutdown/reboot
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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>