diff options
author | Dan Crowell <dcrowell@us.ibm.com> | 2017-09-29 12:55:43 -0500 |
---|---|---|
committer | William G. Hoffa <wghoffa@us.ibm.com> | 2017-10-20 09:07:29 -0400 |
commit | 691a96a53eb439daabf243763b6c56a76891c573 (patch) | |
tree | a3b22596997308cd567e1e96e4979dfb9e550460 /src | |
parent | 3b73246002f677ac22998c3e19c7435aa613ab6b (diff) | |
download | talos-hostboot-691a96a53eb439daabf243763b6c56a76891c573.tar.gz talos-hostboot-691a96a53eb439daabf243763b6c56a76891c573.zip |
Enable OCC on ZZ with Opal
Change-Id: I656c47d2468c8c31509b80492709b0f651b85b42
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/47008
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: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Reviewed-by: Stephen M. Cprek <smcprek@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/include/usr/pnor/pnor_const.H | 16 | ||||
-rw-r--r-- | src/include/usr/pnor/pnorif.H | 1 | ||||
-rw-r--r-- | src/usr/isteps/pm/pm_common.C | 3 | ||||
-rw-r--r-- | src/usr/pnor/pnor_common.C | 1 | ||||
-rw-r--r-- | src/usr/runtime/populate_hbruntime.C | 12 | ||||
-rw-r--r-- | src/usr/util/runtime/utillidmgr_rt.C | 24 | ||||
-rw-r--r-- | src/usr/util/utillidpnor.C | 18 |
7 files changed, 44 insertions, 31 deletions
diff --git a/src/include/usr/pnor/pnor_const.H b/src/include/usr/pnor/pnor_const.H index 4bc6b4a01..37316e87d 100644 --- a/src/include/usr/pnor/pnor_const.H +++ b/src/include/usr/pnor/pnor_const.H @@ -94,7 +94,21 @@ enum PnorMode_t { // Size and layout of this structure must be maintained for debug framework. struct SectionInfo_t { - SectionInfo_t(): id(INVALID_SECTION), secure(false) {} + SectionInfo_t(): + id(INVALID_SECTION), + name("INVALID_SECTION"), + vaddr(0), + flashAddr(0), + size(0), + eccProtected(false), + sha512Version(false), + sha512perEC(false), + readOnly(false), + reprovision(false), + Volatile(false), + secure(false), + clearOnEccErr(false) + {} SectionId id; /**< Identifier for this section */ const char* name; /**< Name of the section */ uint64_t vaddr; /**< Virtual address of the start of the section */ diff --git a/src/include/usr/pnor/pnorif.H b/src/include/usr/pnor/pnorif.H index 5dd4a68e8..7e62e6042 100644 --- a/src/include/usr/pnor/pnorif.H +++ b/src/include/usr/pnor/pnorif.H @@ -263,7 +263,6 @@ errlHndl_t readHeaderMagic( size_t i_size, void* o_pData); -// @TODO CQ:SW400352 remove function /** * @brief Determine if a PNOR section is empty by checking if first PAGE * is all 0xFF's or 0x00's depending on ECC or not. diff --git a/src/usr/isteps/pm/pm_common.C b/src/usr/isteps/pm/pm_common.C index 3551a6b6e..44aa2e99e 100644 --- a/src/usr/isteps/pm/pm_common.C +++ b/src/usr/isteps/pm/pm_common.C @@ -601,6 +601,9 @@ namespace HBPM void* l_occVirt = reinterpret_cast<void *>(i_occImgVaddr); // copy LID to Homer + TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + "Copying %p to %p for %d bytes", + l_occVirt, l_pLidImage, l_lidImageSize ); memcpy(l_occVirt, l_pLidImage, l_lidImageSize); }while(0); diff --git a/src/usr/pnor/pnor_common.C b/src/usr/pnor/pnor_common.C index 3b0195756..20772964d 100644 --- a/src/usr/pnor/pnor_common.C +++ b/src/usr/pnor/pnor_common.C @@ -533,7 +533,6 @@ errlHndl_t PNOR::hasKnownHeader( return pError; } -// @TODO CQ:SW400352 remove function bool PNOR::isSectionEmpty(const PNOR::SectionId i_section) { errlHndl_t l_errhdl = nullptr; diff --git a/src/usr/runtime/populate_hbruntime.C b/src/usr/runtime/populate_hbruntime.C index dbf35db96..4a838ca15 100644 --- a/src/usr/runtime/populate_hbruntime.C +++ b/src/usr/runtime/populate_hbruntime.C @@ -1178,15 +1178,11 @@ errlHndl_t populate_HbRsvMem(uint64_t i_nodeId) // -- HCODE // -- Non-verified Images /// -- RINGOVD - // @TODO CQ:SW400352 add OCC PNOR support for fsp back - if (!INITSERVICE::spBaseServicesEnabled()) + l_elog = hbResvLoadSecureSection(PNOR::OCC, i_nodeId, + l_prevDataAddr, l_prevDataSize); + if (l_elog) { - l_elog = hbResvLoadSecureSection(PNOR::OCC, i_nodeId, - l_prevDataAddr, l_prevDataSize); - if (l_elog) - { - break; - } + break; } l_elog = hbResvLoadSecureSection(PNOR::WOFDATA, i_nodeId, l_prevDataAddr, l_prevDataSize); diff --git a/src/usr/util/runtime/utillidmgr_rt.C b/src/usr/util/runtime/utillidmgr_rt.C index f1cc8606a..338f22b87 100644 --- a/src/usr/util/runtime/utillidmgr_rt.C +++ b/src/usr/util/runtime/utillidmgr_rt.C @@ -34,6 +34,7 @@ #include <secureboot/containerheader.H> #include <trace/interface.H> #include "../utilbase.H" +#include <util/utillidpnor.H> UtilLidMgr::UtilLidMgr(uint32_t i_lidId) : iv_isLidInPnor(false), iv_lidBuffer(nullptr), iv_lidSize(0), @@ -131,6 +132,7 @@ errlHndl_t UtilLidMgr::releaseLidImage(void) errlHndl_t UtilLidMgr::loadLid() { if (nullptr != iv_lidBuffer) return nullptr; + UTIL_FT("UtilLidMgr::loadLid"); const char* l_addr = nullptr; size_t l_size = 0; @@ -140,8 +142,13 @@ errlHndl_t UtilLidMgr::loadLid() { if(iv_isLidInHbResvMem) { + UTIL_FT("UtilLidMgr::loadLid> iv_isLidInHbResvMem=true"); iv_lidBuffer = reinterpret_cast<void*>(g_hostInterfaces-> - get_reserved_mem(PNOR::SectionIdToString(iv_lidPnorInfo.id),0)); + get_reserved_mem( + PNOR::SectionIdToString( + Util::getLidPnorSection( + static_cast<Util::LidId>(iv_lidId))), + 0)); // If nullptr returned, set size to 0 to indicate we could not find // the lid in HB resv memory @@ -172,6 +179,7 @@ errlHndl_t UtilLidMgr::loadLid() { // If no secure header, just use PNOR size iv_lidSize = iv_lidPnorInfo.size; + UTIL_FT("UtilLidMgr::loadLid - iv_lidSize=%d", iv_lidSize ); // Need to increment past header if one exists if (iv_lidPnorInfo.sha512Version) @@ -181,12 +189,15 @@ errlHndl_t UtilLidMgr::loadLid() iv_lidBuffer = static_cast<uint8_t*>(iv_lidBuffer) + PAGESIZE; iv_lidSize -= PAGESIZE; + UTIL_FT("UtilLidMgr::loadLid - iv_lidSize=%d", + iv_lidSize ); } } } } else if(iv_isLidInVFS) { + UTIL_FT("UtilLidMgr::loadLid> iv_isLidInVFS=true"); l_errl = VFS::module_address(iv_lidFileName, l_addr, l_size); if (l_errl) { @@ -198,12 +209,14 @@ errlHndl_t UtilLidMgr::loadLid() } else if (iv_isLidInPnor) { + UTIL_FT("UtilLidMgr::loadLid> iv_isLidInPnor=true"); iv_lidSize = iv_lidPnorInfo.size; iv_lidBuffer = reinterpret_cast<char *>(iv_lidPnorInfo.vaddr); } else if( g_hostInterfaces->lid_load && iv_spBaseServicesEnabled ) { + UTIL_FT("UtilLidMgr::loadLid> Calling lid_load(0x%.8X)", iv_lidId); int rc = g_hostInterfaces->lid_load(iv_lidId, &iv_lidBuffer, &iv_lidSize); if (0 != rc) @@ -284,6 +297,7 @@ errlHndl_t UtilLidMgr::cleanup() void UtilLidMgr::updateLid(uint32_t i_lidId) { + UTIL_FT("UtilLidMgr::updateLid - i_lidId=0x%.8X", i_lidId); iv_lidId = i_lidId; // First check if lid is already in hostboot reserved memory @@ -330,14 +344,6 @@ const uint32_t * UtilLidMgr::getLidList(size_t * o_num) bool UtilLidMgr::lidInHbResvMem(const uint32_t i_lidId) const { - // @TODO CQ:SW400352 Remove this when fsp adds in PNOR support - // hostboot could not verify it from pnor, so it is not in hb resv meomory - if (iv_spBaseServicesEnabled && - (i_lidId == Util::OCC_LIDID || i_lidId == Util::OCC_CONTAINER_LIDID)) - { - return false; - } - return i_lidId == Util::OCC_LIDID || i_lidId == Util::OCC_CONTAINER_LIDID || i_lidId == Util::WOF_LIDID || diff --git a/src/usr/util/utillidpnor.C b/src/usr/util/utillidpnor.C index 109daa3dd..de69964a2 100644 --- a/src/usr/util/utillidpnor.C +++ b/src/usr/util/utillidpnor.C @@ -157,22 +157,18 @@ bool UtilLidMgr::getLidPnorSectionInfo(uint32_t i_lidId, } #endif #endif - // @TODO CQ:SW400352 remove this check - if ((l_secId == PNOR::OCC) -#ifndef __HOSTBOOT_RUNTIME - && PNOR::isSectionEmpty(l_secId) -#else - //use this check for HBRT due to secure lid load setting vaddr - //to zero -- which causes isSectionEmpty to segfault - && !o_lidPnorInfo.vaddr -#endif - ) + +#ifdef __HOSTBOOT_RUNTIME + //use this check for HBRT due to secure lid load setting vaddr + //to zero -- which causes isSectionEmpty to segfault + if( !o_lidPnorInfo.vaddr ) { - UTIL_FT("UtilLidMgr::getLidPnorSection PNOR section %s is empty get data from LID transfer", + UTIL_FT("UtilLidMgr::getLidPnorSection PNOR section %s is empty or secure", PNOR::SectionIdToString(l_secId)); l_lidInPnor = false; break; } +#endif } } } while(0); |