diff options
author | Christian Geddes <crgeddes@us.ibm.com> | 2018-05-03 16:35:08 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-06-02 16:10:29 -0400 |
commit | 17d1f78337ea7f5bfbb0ee727e63495dd7bb437b (patch) | |
tree | 539d51896e9e422751e5acb1a705fb46aaf7578d /src/usr/targeting/targetservicestart.C | |
parent | 1d21270b627aaef8b43aff215fa626ff0d36347d (diff) | |
download | talos-hostboot-17d1f78337ea7f5bfbb0ee727e63495dd7bb437b.tar.gz talos-hostboot-17d1f78337ea7f5bfbb0ee727e63495dd7bb437b.zip |
Refactor re-init of targeting data during MPIPL/HBRT startup
There are a couple of things we have to do to targets/attrs when we
either transition from Hostboot->HBRT or from HBRT->Hostboot during
an MPIPL. These include resetting all of the mutex attrs so they
are in the unlocked state and updating the pointer which PEER_TARGET
stores as a value to reflect the change in the memory mapping. For
both of these tasks we need to loop through all of the targets.This
refactor allows both these tasks to be done in the same loop.
Change-Id: I23614bba11b2c9eabb97a7ddc7a53937f83dc131
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/58316
Reviewed-by: Martin Gloff <mgloff@us.ibm.com>
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: Benjamin J. Weisenbeck <bweisenb@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/targeting/targetservicestart.C')
-rwxr-xr-x | src/usr/targeting/targetservicestart.C | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/usr/targeting/targetservicestart.C b/src/usr/targeting/targetservicestart.C index 00393b017..5b7e639dd 100755 --- a/src/usr/targeting/targetservicestart.C +++ b/src/usr/targeting/targetservicestart.C @@ -194,7 +194,33 @@ static void initTargeting(errlHndl_t& io_pError) //Ensure all mutex attributes are reset on MPIPL if(l_isMpipl) { - l_targetService.resetMutexAttributes(); + // updatePeerTargets will write to read-only attribute pages + // to get around vmm fails we need to allow writes to readonly + // memory for the duration of this loop + l_targetService.modifyReadOnlyPagePermissions(true); + uint32_t l_peerTargetsAdjusted = 0; + uint32_t l_numberMutexAttrsReset = 0; + for( auto targ_iter = l_targetService.begin(); + targ_iter != l_targetService.end(); + targ_iter++) + { + const Target* l_pTarget = *targ_iter; + // Check if there any mutex attributes we need to reset on this target + l_numberMutexAttrsReset += l_targetService.resetMutexAttributes(l_pTarget); + + // Update any peer target addresses if necessary + if(l_targetService.updatePeerTarget(l_pTarget)) + { + l_peerTargetsAdjusted++; + } + } + // Now that the loop is complete we can re-apply + // the read only permissions to the read only attr pages + l_targetService.modifyReadOnlyPagePermissions(false); + TARG_INF("Number of peer target addresses adjusted: %d", + l_peerTargetsAdjusted); + TARG_INF("Number of mutex attributes reset: %d", + l_numberMutexAttrsReset); } checkProcessorTargeting(l_targetService); |