diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2012-08-20 12:02:55 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-09-06 08:30:05 -0500 |
commit | 4af5b97526d99ecb9e232b1933c804858a298876 (patch) | |
tree | 2156b6d6c8e4961acf5cb6e4c662add8af8c8f29 /src/usr/hwpf/hwp | |
parent | 8fc9c877be31195fcd7ca4f9c28c78acf61b0937 (diff) | |
download | talos-hostboot-4af5b97526d99ecb9e232b1933c804858a298876.tar.gz talos-hostboot-4af5b97526d99ecb9e232b1933c804858a298876.zip |
Nap instruction sometimes executed with wrong permissions.
When executing the nap instruction, all thread state can be
lost. This was causing r0 to be lost, which contained the
system-call number for the idle thread to request permission
to execute nap and as a result 'task-yield' was executed
instead of 'cpu-nap' after the idle thread took its first
nap.
Re-arranged the sreset code that handles nap-wakeup to deal
with thread-state being lost when entering nap and instead
using the previously saved task-state from the 'cpu-nap'
system call.
Change-Id: Id7468a8577c4d7b273b23bc97e7dd040555e7b67
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1567
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/hwp')
-rw-r--r-- | src/usr/hwpf/hwp/thread_activate/thread_activate.C | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/usr/hwpf/hwp/thread_activate/thread_activate.C b/src/usr/hwpf/hwp/thread_activate/thread_activate.C index 72a36bbbf..c8f418f35 100644 --- a/src/usr/hwpf/hwp/thread_activate/thread_activate.C +++ b/src/usr/hwpf/hwp/thread_activate/thread_activate.C @@ -61,7 +61,7 @@ void activate_threads( errlHndl_t& io_rtaskRetErrl ) { errlHndl_t l_errl = NULL; - TRACFCOMP( g_fapiTd, + TRACFCOMP( g_fapiTd, "activate_threads entry" ); // get the master processor target @@ -71,7 +71,7 @@ void activate_threads( errlHndl_t& io_rtaskRetErrl ) { TRACFCOMP( g_fapiImpTd, "Could not find master proc!!!" ); - assert(false); + assert(false); } // get the list of core targets for this proc chip @@ -88,8 +88,8 @@ void activate_threads( errlHndl_t& io_rtaskRetErrl ) task_affinity_unpin(); //NNNCCCPPPPTTT - uint64_t l_masterCoreID = (cpuid & 0x0078)>>3; - uint64_t l_masterThreadID = (cpuid & 0x0007); + uint64_t l_masterCoreID = (cpuid & 0x0078)>>3; + uint64_t l_masterThreadID = (cpuid & 0x0007); TARGETING::Target* l_masterCore = NULL; for( TARGETING::TargetHandleList::iterator core_it @@ -106,7 +106,7 @@ void activate_threads( errlHndl_t& io_rtaskRetErrl ) } if( l_masterCore == NULL ) { - TRACFCOMP( g_fapiImpTd, + TRACFCOMP( g_fapiImpTd, "Could not find a target for core %d", l_masterCoreID ); /*@ @@ -130,7 +130,7 @@ void activate_threads( errlHndl_t& io_rtaskRetErrl ) return; } - TRACFCOMP( g_fapiTd, + TRACFCOMP( g_fapiTd, "Master CPU : c%d t%d (HUID=%.8X)", l_masterCoreID, l_masterThreadID, TARGETING::get_huid(l_masterCore) ); @@ -157,7 +157,7 @@ void activate_threads( errlHndl_t& io_rtaskRetErrl ) } // send a magic instruction for PHYP Simics to work... - MAGIC_INSTRUCTION(MAGIC_SIMICS_CORESTATESAVE); + MAGIC_INSTRUCTION(MAGIC_SIMICS_CORESTATESAVE); //@todo - call the real proc_thread_control HWP (RTC:42816) #if 0 @@ -184,7 +184,7 @@ void activate_threads( errlHndl_t& io_rtaskRetErrl ) l_threadState ); //o_thread_state if ( l_errl ) { - TRACFCOMP( g_fapiImpTd, + TRACFCOMP( g_fapiImpTd, "ERROR: 0x%.8X : proc_thread_control HWP( cpu %d, thread %d )", l_errl->reasonCode(), l_masterCoreID, @@ -195,7 +195,7 @@ void activate_threads( errlHndl_t& io_rtaskRetErrl ) } else { - TRACFCOMP( g_fapiTd, + TRACFCOMP( g_fapiTd, "SUCCESS: 0x%.8X : proc_thread_control HWP( cpu %d, thread %d )", l_errl->reasonCode(), l_masterCoreID, @@ -218,7 +218,7 @@ void activate_threads( errlHndl_t& io_rtaskRetErrl ) // Make sure the thread is in maintenance mode if( !(statreg & 0x0000040000000000) ) //21:PTC_RAS_STAT_MAINT { - TRACFCOMP( g_fapiImpTd, + TRACFCOMP( g_fapiImpTd, "ERROR: Thread c%d t%d is in the wrong state : Status=%.16X", l_masterCoreID, thread, @@ -258,9 +258,9 @@ void activate_threads( errlHndl_t& io_rtaskRetErrl ) DEVICE_SCOM_ADDRESS(rasStatAddr) ); if( l_errl ) { break; } - if( !(statreg & 0x0000000000001000) ) //51:PTC_RAS_STAT_RUN_BIT + if( !(statreg & 0x0008000000000000) ) //12:PTC_RAS_STAT_INST_COMP { - TRACFCOMP( g_fapiImpTd, + TRACFCOMP( g_fapiImpTd, "ERROR: Thread c%d t%d did not start : Status=%.16X", l_masterCoreID, thread, @@ -285,14 +285,14 @@ void activate_threads( errlHndl_t& io_rtaskRetErrl ) } #endif - TRACFCOMP( g_fapiTd, + TRACFCOMP( g_fapiTd, "SUCCESS: Thread c%d t%d started", l_masterCoreID, thread ); } - TRACFCOMP( g_fapiTd, + TRACFCOMP( g_fapiTd, "activate_threads exit" ); io_rtaskRetErrl = l_errl; |