diff options
author | Dan Crowell <dcrowell@us.ibm.com> | 2018-03-08 15:26:29 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-03-16 13:26:03 -0400 |
commit | 945553cc05cf2ab168a6dc435e8160997402be10 (patch) | |
tree | a1e649c4e03deae6fcfd4482dbab07deef0baa32 /src/usr/diag/prdf/plat | |
parent | 05cda10a435a9e9b86a1971e6ab56365b29cc861 (diff) | |
download | talos-hostboot-945553cc05cf2ab168a6dc435e8160997402be10.tar.gz talos-hostboot-945553cc05cf2ab168a6dc435e8160997402be10.zip |
Force single-threaded access to HWPs in PRD
Hostboot does not support thread local storage, however several
HWPs use this concept. Specifically the memory HWPs use it for
their c_str() function that prints out target strings. If these
HWPs are called in multiple threads there is a chance of a buffer
overrun that leads to a crash.
The fix is to create a new INVOKE-style macro that befores the
same mutex lock as a regular FAPI_INVOKE_HWP call.
Change-Id: I550fc752f6a6b1bb51ecb4f9c8a7011f98bb8cd3
CQ: SW420212
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/55289
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Tested-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/diag/prdf/plat')
-rw-r--r-- | src/usr/diag/prdf/plat/prdfPlatServices.C | 12 | ||||
-rw-r--r-- | src/usr/diag/prdf/plat/prdfPlatServices_ipl.C | 18 |
2 files changed, 18 insertions, 12 deletions
diff --git a/src/usr/diag/prdf/plat/prdfPlatServices.C b/src/usr/diag/prdf/plat/prdfPlatServices.C index d5c7b500a..1292c6066 100644 --- a/src/usr/diag/prdf/plat/prdfPlatServices.C +++ b/src/usr/diag/prdf/plat/prdfPlatServices.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2016,2017 */ +/* Contributors Listed Below - COPYRIGHT 2016,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -441,10 +441,12 @@ uint32_t __startTdScrubMaster_mca( ExtensibleChip * i_mcaChip, // Get the address rank of the master rank. uint32_t port = i_mcaChip->getPos() % MAX_MCA_PER_MCBIST; mss::mcbist::address saddr, eaddr; - mss::mcbist::address::get_mrank_range( port, - i_rank.getDimmSlct(), - i_rank.getRankSlct(), - saddr, eaddr ); + FAPI_CALL_HWP_NORETURN( + mss::mcbist::address::get_mrank_range, + port, + i_rank.getDimmSlct(), + i_rank.getRankSlct(), + saddr, eaddr ); return __startTdScrub_mca( i_mcaChip, saddr, eaddr, i_stopCond ); } diff --git a/src/usr/diag/prdf/plat/prdfPlatServices_ipl.C b/src/usr/diag/prdf/plat/prdfPlatServices_ipl.C index a5bfe1843..06eb609f1 100644 --- a/src/usr/diag/prdf/plat/prdfPlatServices_ipl.C +++ b/src/usr/diag/prdf/plat/prdfPlatServices_ipl.C @@ -259,7 +259,9 @@ bool isBroadcastModeCapable<TYPE_MCBIST>( ExtensibleChip * i_chip ) fapi2::Target<fapi2::TARGET_TYPE_MCBIST> fapiTrgt ( i_chip->getTrgt() ); - return ( mss::states::YES == mss::mcbist::is_broadcast_capable(fapiTrgt) ); + mss::states l_ret = mss::states::NO; + FAPI_CALL_HWP( l_ret, mss::mcbist::is_broadcast_capable, fapiTrgt ); + return ( mss::states::YES == l_ret ); } //------------------------------------------------------------------------------ @@ -296,12 +298,14 @@ uint32_t startSfRead<TYPE_MCA>( ExtensibleChip * i_mcaChip, // Get the first address of the given rank. uint32_t port = i_mcaChip->getPos() % MAX_MCA_PER_MCBIST; mss::mcbist::address saddr, eaddr; - mss::mcbist::address::get_srank_range( port, - i_rank.getDimmSlct(), - i_rank.getRankSlct(), - i_rank.getSlave(), - saddr, - eaddr ); + FAPI_CALL_HWP_NORETURN( + mss::mcbist::address::get_srank_range, + port, + i_rank.getDimmSlct(), + i_rank.getRankSlct(), + i_rank.getSlave(), + saddr, + eaddr ); do { |