Skip to content

Commit

Permalink
Clear out HOMER attributes and reset PM in PHYP mode
Browse files Browse the repository at this point in the history
During the IPL, Hostboot will initialize part of the PM Complex
and setup the HOMER memory spaces.  At runtime, PHYP will reinit
the complex with its own memory spaces.  This change explicitly
resets the complex and clears any related HOMER attributes before
jumping to PHYP so that the first call at runtime starts completely
fresh.

Change-Id: I540b79143d5fbba876ffc0ac72721639153a1cfa
CQ: SW444669
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/65983
Reviewed-by: Matt Derksen <mderkse1@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: Corey V. Swenson <cswenson@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
  • Loading branch information
dcrowell77 authored and wghoffa committed Sep 18, 2018
1 parent 1f6ed77 commit f04d03f
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 12 deletions.
17 changes: 15 additions & 2 deletions src/include/usr/isteps/pm/pm_common_ext.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -83,6 +83,17 @@ namespace HBPM
HCODE_LOADED = 0x1,
};

/**
* @brief Enumeration of the attribute
*
*/
enum resetOptions_t
{
RESET_HW = 0x1,
CLEAR_ATTRIBUTES = 0x2,
RESET_AND_CLEAR_ATTRIBUTES = (RESET_HW | CLEAR_ATTRIBUTES),
};

/**
* @brief Convert HOMER physical address space to a vitual address
* @param[in] i_proc_target Processsor target
Expand All @@ -106,9 +117,11 @@ namespace HBPM
/**
* @brief Reset PM Complex for all proc targets.
*
* @param[in] i_opt Option to reset HW, attributes, or both
*
* @return errlHndl_t Error log if resetPMAll failed
*/
errlHndl_t resetPMAll();
errlHndl_t resetPMAll( resetOptions_t i_opt = RESET_HW );

/**
* @brief Verify all OCCs at checkpoint.
Expand Down
28 changes: 28 additions & 0 deletions src/usr/isteps/istep21/call_host_runtime_setup.C
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#include <sys/misc.h>

#include <hbotcompid.H>
#include <util/misc.H>

#include "freqAttrData.H"

Expand Down Expand Up @@ -736,6 +737,33 @@ void* call_host_runtime_setup (void *io_pArgs)
}
#endif
}
// No support for OCC
else if( !Util::isSimicsRunning() )
{
// Since we are not leaving the PM complex alive, we will
// explicitly put it into reset and clean up any memory
l_err = HBPM::resetPMAll(HBPM::RESET_AND_CLEAR_ATTRIBUTES);
if (l_err)
{
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"resetPMAll failed");

// Commit the error and continue with the istep
errlCommit(l_err, ISTEP_COMP_ID);

// Force an attribute clear here even if the rest failed
l_err = HBPM::resetPMAll(HBPM::CLEAR_ATTRIBUTES);
if( l_err )
{
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"Explicit attribute clear failed");
// no reason to keep this log around, most likely it
// is the same fail we hit above
delete l_err;
l_err = nullptr;
}
}
}

#ifdef CONFIG_IPLTIME_CHECKSTOP_ANALYSIS
if(TARGETING::is_phyp_load() )
Expand Down
47 changes: 37 additions & 10 deletions src/usr/isteps/pm/pm_common.C
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,16 @@ namespace HBPM
}
}

l_virt_addr = HBPM_MAP(HBPM_PHYS_ADDR,
sizeof(Homerlayout_t));
// Remap unless we're zeroing things out
if( i_phys_addr )
{
l_virt_addr = HBPM_MAP(HBPM_PHYS_ADDR,
sizeof(Homerlayout_t));
}
else
{
l_virt_addr = nullptr;
}

// Update the attributes for the current values
i_proc_target->setAttr<ATTR_HOMER_PHYS_ADDR>(i_phys_addr);
Expand Down Expand Up @@ -1110,26 +1118,45 @@ namespace HBPM
/**
* @brief Reset PM complex for all chips
*/
errlHndl_t resetPMAll()
errlHndl_t resetPMAll( resetOptions_t i_opt )
{
errlHndl_t l_errl = nullptr;

TargetHandleList l_procChips;
getAllChips(l_procChips, TYPE_PROC, true);

TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"resetPMAll: %d proc(s) found",
"resetPMAll(%d): %d proc(s) found",
i_opt,
l_procChips.size());

for (const auto & l_procChip: l_procChips)
{
l_errl = resetPMComplex(l_procChip);
if( l_errl )
if( RESET_HW & i_opt )
{
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
ERR_MRK"resetPMAll: "
"reset PM complex failed!" );
break;
l_errl = resetPMComplex(l_procChip);
if( l_errl )
{
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
ERR_MRK"resetPMAll: "
"reset PM complex failed!" );
break;
}
}

if( CLEAR_ATTRIBUTES & i_opt )
{
(void) convertHomerPhysToVirt( l_procChip, 0 );
}
}

if( !l_errl )
{
if( CLEAR_ATTRIBUTES & i_opt )
{
TARGETING::Target* sys = nullptr;
TARGETING::targetService().getTopLevelTarget(sys);
sys->setAttr<ATTR_OCC_COMMON_AREA_PHYS_ADDR>(0);
}
}

Expand Down

0 comments on commit f04d03f

Please sign in to comment.