From: Gang W. <gan...@in...> - 2011-12-22 05:22:34
|
changeset f4a2f11d774b in /var/www/tboot.hg details: tboot.hg?cmd=changeset;node=f4a2f11d774b description: imported patch shutdown.patch diffstat: tboot/common/tboot.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diffs (25 lines): diff -r c50f3e0dbece -r f4a2f11d774b tboot/common/tboot.c --- a/tboot/common/tboot.c Fri Dec 09 14:09:09 2011 +0800 +++ b/tboot/common/tboot.c Wed Dec 21 14:38:35 2011 +0800 @@ -457,14 +457,21 @@ void shutdown(void) { + static atomic_t ap_in_shutdown; + /* wait-for-sipi only invoked for APs, so skip all BSP shutdown code */ if ( _tboot_shared.shutdown_type == TB_SHUTDOWN_WFS ) { + atomic_inc(&ap_in_shutdown); mtx_enter(&ap_lock); printk("shutdown(): TB_SHUTDOWN_WFS\n"); handle_init_sipi_sipi(get_apicid()); apply_policy(TB_ERR_FATAL); } + printk("wait until all APs ready for txt shutdown\n"); + while( atomic_read(&ap_wfs_count) < atomic_read(&ap_in_shutdown) ) + cpu_relax(); + /* ensure localities 0, 1 are inactive (in case kernel used them) */ release_locality(0); release_locality(1); |