diff options
| author | Stephen Cprek <smcprek@us.ibm.com> | 2017-12-15 10:24:02 -0600 |
|---|---|---|
| committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-12-20 13:54:35 -0500 |
| commit | 34dbdc49d0d14933c317be2815302d0d558c5924 (patch) | |
| tree | d65d06b6901b0188057263519bf0b2f127b3ddd0 /src/include/usr | |
| parent | 1dce3206aa219d0cef4501b6795255a730f4ecba (diff) | |
| download | talos-hostboot-34dbdc49d0d14933c317be2815302d0d558c5924.tar.gz talos-hostboot-34dbdc49d0d14933c317be2815302d0d558c5924.zip | |
Convert asserts to error logs where it makes sense
Change-Id: Idd15e39cc6be44c0865f13503bfa4482d77fcf0d
RTC:181899
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/51042
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Michael Baiocchi <mbaiocch@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: Martin Gloff <mgloff@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/usr')
| -rw-r--r-- | src/include/usr/pnor/pnor_reasoncodes.H | 5 | ||||
| -rw-r--r-- | src/include/usr/runtime/runtime_reasoncodes.H | 10 | ||||
| -rw-r--r-- | src/include/usr/secureboot/header.H | 6 | ||||
| -rw-r--r-- | src/include/usr/secureboot/secure_reasoncodes.H | 8 | ||||
| -rw-r--r-- | src/include/usr/secureboot/service.H | 5 | ||||
| -rw-r--r-- | src/include/usr/util/util_reasoncodes.H | 2 | ||||
| -rw-r--r-- | src/include/usr/util/utillidmgr.H | 54 |
7 files changed, 64 insertions, 26 deletions
diff --git a/src/include/usr/pnor/pnor_reasoncodes.H b/src/include/usr/pnor/pnor_reasoncodes.H index e9e98f9c5..589337a3b 100644 --- a/src/include/usr/pnor/pnor_reasoncodes.H +++ b/src/include/usr/pnor/pnor_reasoncodes.H @@ -182,6 +182,11 @@ namespace PNOR RC_NOT_A_LOADED_SECTION = PNOR_COMP_ID | 0x35, RC_NOT_A_SUPPORTED_SECTION = PNOR_COMP_ID | 0x36, RC_SECURE_UNLOAD_DISALLOWED = PNOR_COMP_ID | 0x37, + RC_SECURE_TOTAL_SIZE_INVAL = PNOR_COMP_ID | 0x38, + RC_SECURE_VADDR_MISMATCH = PNOR_COMP_ID | 0x39, + RC_SECURE_SIZE_MISMATCH = PNOR_COMP_ID | 0x3A, + RC_NOT_PAGE_ALIGNED = PNOR_COMP_ID | 0x3B, + RC_SECURE_PRO_SIZE_MISMATCH = PNOR_COMP_ID | 0x3C, //@fixme-RTC:131607-Temporary value to allow HWSV compile //termination_rc diff --git a/src/include/usr/runtime/runtime_reasoncodes.H b/src/include/usr/runtime/runtime_reasoncodes.H index 8bf056675..4ce07c0c2 100644 --- a/src/include/usr/runtime/runtime_reasoncodes.H +++ b/src/include/usr/runtime/runtime_reasoncodes.H @@ -45,6 +45,8 @@ namespace RUNTIME MOD_HDATSERVICE_MAPREGION = 0x0B, /**< hdatservice.C */ MOD_HDATSERVICE_GETINSTANCECOUNT = 0x0C, /**< hdatservice.C */ MOD_HDATSERVICE_GETANDCHECKTUPLE = 0x0D, /**< hdatservice.C */ + MOD_PREVERLIDMGR_LOAD_FROM_PNOR = 0x0E, /** preverifiedlidmgr.C **/ + MOD_PREVERLIDMGR_LOAD_IMAGE = 0x0F, /** preverifiedlidmgr.C **/ // customize_attrs_for_payload.C MOD_CUST_COMP_NON_PHYP_RT_TARGET = 0x12, @@ -104,6 +106,14 @@ namespace RUNTIME RC_EXCEEDED_MEMORY = RUNTIME_COMP_ID | 0x27, RC_UNABLE_TO_PIN_ATTR_MEM = RUNTIME_COMP_ID | 0x28, RC_UNABLE_TO_UNPIN_ATTR_MEM = RUNTIME_COMP_ID | 0x29, + RC_TPM_HDAT_OUT_OF_SPACE = RUNTIME_COMP_ID | 0x2A, + RC_TPM_HDAT_ID_MISMATCH = RUNTIME_COMP_ID | 0x2B, + RC_TPM_HDAT_EYE_CATCH_MISMATCH = RUNTIME_COMP_ID | 0x2C, + RC_TPM_MISSING_PROC = RUNTIME_COMP_ID | 0x2D, + RC_TPM_HDAT_BAD_VERSION = RUNTIME_COMP_ID | 0x2E, + RC_TPM_HDAT_BAD_NUM_I2C = RUNTIME_COMP_ID | 0x2F, + RC_INVALID_LID = RUNTIME_COMP_ID | 0x30, + RC_PREVER_INVALID_SIZE = RUNTIME_COMP_ID | 0x31, }; enum UserDetailsTypes diff --git a/src/include/usr/secureboot/header.H b/src/include/usr/secureboot/header.H index eff1f6769..259d98467 100644 --- a/src/include/usr/secureboot/header.H +++ b/src/include/usr/secureboot/header.H @@ -28,6 +28,8 @@ #include <stdint.h> #include <pnor/pnorif.H> #include <util/singleton.H> +#include <errl/errlentry.H> +#include <errl/errlmanager.H> /** @file header.H * @@ -64,9 +66,9 @@ namespace SECUREBOOT * area preserved across the bootloader to HBB handoff to * support extending HBB measurements to TPM * - * @warning Asserts if header is already cached (code bug) + * @return Error handle if error; otherwise nullptr */ - void loadHeader(); + errlHndl_t loadHeader(); /** * @brief Return pointer to base image (HBB) header. diff --git a/src/include/usr/secureboot/secure_reasoncodes.H b/src/include/usr/secureboot/secure_reasoncodes.H index 21c195b77..49d42e15f 100644 --- a/src/include/usr/secureboot/secure_reasoncodes.H +++ b/src/include/usr/secureboot/secure_reasoncodes.H @@ -44,6 +44,9 @@ namespace SECUREBOOT MOD_SECURE_CONT_HDR_PARSE = 0x0A, MOD_SECURE_CONT_HDR_CPY_INC = 0x0B, MOD_SECURE_CONT_VALIDATE = 0x0C, + MOD_SECURE_SET_SBE_SECURE_MODE = 0x0D, + MOD_SECURE_GET_ALL_SEC_REGS = 0x0E, + MOD_SECURE_LOAD_HEADER = 0x0F, }; enum SECUREReasonCode @@ -61,6 +64,11 @@ namespace SECUREBOOT RC_SECROM_INVALID = SECURE_COMP_ID | 0x0B, RC_CONT_HDR_NO_SPACE = SECURE_COMP_ID | 0x0C, RC_CONT_HDR_INVALID = SECURE_COMP_ID | 0x0D, + RC_SBE_INVALID_SEC_MODE = SECURE_COMP_ID | 0x0E, + RC_DEVICE_WRITE_ERR = SECURE_COMP_ID | 0x0F, + RC_PROC_NOT_SCOMABLE = SECURE_COMP_ID | 0x10, + RC_DEVICE_READ_ERR = SECURE_COMP_ID | 0x11, + RC_INVALID_BASE_HEADER = SECURE_COMP_ID | 0x12, // Reason codes 0xA0 - 0xEF reserved for trustedboot_reasoncodes.H }; diff --git a/src/include/usr/secureboot/service.H b/src/include/usr/secureboot/service.H index dc1fd5a78..7d8953cde 100644 --- a/src/include/usr/secureboot/service.H +++ b/src/include/usr/secureboot/service.H @@ -347,8 +347,11 @@ namespace SECUREBOOT * a value of 0 if SBE should check for security disable * requests and 1 if not. All other values are not * allowed and will be rejected via an assert. + * + * @return errlHndl_t Error log handle; nullptr if success, pointer to + * valid error log otherwise. */ - void setSbeSecurityMode(uint8_t i_sbeSecurityMode); + errlHndl_t setSbeSecurityMode(uint8_t i_sbeSecurityMode); } diff --git a/src/include/usr/util/util_reasoncodes.H b/src/include/usr/util/util_reasoncodes.H index 2b43b6757..587943bdd 100644 --- a/src/include/usr/util/util_reasoncodes.H +++ b/src/include/usr/util/util_reasoncodes.H @@ -51,6 +51,7 @@ namespace Util UTIL_MCL_REL_MEM = 0x11, // MasterContainerLidMgr::releaseMem UTIL_MCL_PROCESS_COMP = 0x12, // MasterContainerLidMgr::processComponent UTIL_MOD_GET_OBUS_PLL_BUCKET = 0x14, // UtilCommonAttr::getObusPllBucket + UTIL_LIDMGR_CSTOR = 0x15, // UtilLidMgr::UtilLidMgr }; enum ReasonCode @@ -81,6 +82,7 @@ namespace Util UTIL_MCL_SIZE_MISMATCH = UTIL_COMP_ID | 0x18, UTIL_ERC_NO_FREQ_LIST = UTIL_COMP_ID | 0x1A, UTIL_ERC_NO_MATCHING_FREQ = UTIL_COMP_ID | 0x1B, + UTIL_LIDMGR_INVAL_LID_REQUEST = UTIL_COMP_ID | 0x1C, }; }; diff --git a/src/include/usr/util/utillidmgr.H b/src/include/usr/util/utillidmgr.H index c2ac2d9a0..a80f67876 100644 --- a/src/include/usr/util/utillidmgr.H +++ b/src/include/usr/util/utillidmgr.H @@ -83,6 +83,7 @@ class UtilLidMgr * @par Detailed Description * Ensures member variables are initialized to sane values. * Sets the initial LID ID. + * Note will shutdown if error occurs during updateLid and not Runtime * * @param[in] i_lidId * LID ID. @@ -111,8 +112,8 @@ class UtilLidMgr * LID ID. * * @return errlHndl_t - * return errl == NULL -> success - * return errl != NULL -> failure + * return errl == nullptr -> success + * return errl != nullptr -> failure */ errlHndl_t setLidId(uint32_t i_lidId); @@ -127,8 +128,8 @@ class UtilLidMgr * Size of the LID in bytes. * * @return errlHndl_t - * return errl == NULL -> success - * return errl != NULL -> failure + * return errl == nullptr -> success + * return errl != nullptr -> failure */ errlHndl_t getLidSize(size_t& o_lidSize); @@ -150,8 +151,8 @@ class UtilLidMgr * for LID. * * @return errlHndl_t - * return errl == NULL -> success - * return errl != NULL -> failure + * return errl == nullptr -> success + * return errl != nullptr -> failure */ errlHndl_t getLid(void* i_dest, size_t i_destSize); @@ -173,8 +174,8 @@ class UtilLidMgr * * * @return errlHndl_t - * return errl == NULL -> success - * return errl != NULL -> failure + * return errl == nullptr -> success + * return errl != nullptr -> failure */ errlHndl_t getStoredLidImage(void*& o_pLidImage, size_t& o_lidImageSize); @@ -187,8 +188,8 @@ class UtilLidMgr * Clears variables associated with storing the image. * * @return errlHndl_t - * return errl == NULL -> success - * return errl != NULL -> failure + * return errl == nullptr -> success + * return errl != nullptr -> failure */ errlHndl_t releaseLidImage(void); @@ -202,7 +203,7 @@ class UtilLidMgr */ inline const void* getLidVirtAddr() const { - const void* l_addr = NULL; + const void* l_addr = nullptr; // Get pointer to PNOR vaddr if (iv_isLidInPnor) { @@ -239,8 +240,11 @@ class UtilLidMgr * * @param[in] i_lidId * LID ID. + * @return errlHndl_t + * return errl == nullptr -> success + * return errl != nullptr -> failure */ - void updateLid(uint32_t i_lidId); + errlHndl_t updateLid(uint32_t i_lidId); /** * @brief performs object cleanup when a new lidId is set @@ -272,8 +276,8 @@ class UtilLidMgr * Indicates image was found in PNOR * * @return errlHndl_t - * return errl == NULL -> success - * return errl != NULL -> failure + * return errl == nullptr -> success + * return errl != nullptr -> failure */ errlHndl_t getLidSizePnor(size_t& o_lidSize, bool& o_imgInPnor); @@ -302,8 +306,8 @@ class UtilLidMgr * Indicates image was found in PNOR * * @return errlHndl_t - * return errl == NULL -> success - * return errl != NULL -> failure + * return errl == nullptr -> success + * return errl != nullptr -> failure */ errlHndl_t getLidPnor(void* i_dest, size_t i_destSize, @@ -335,8 +339,8 @@ class UtilLidMgr * the mutex. * * @return errlHndl_t - * return errl == NULL -> success - * return errl != NULL -> failure + * return errl == nullptr -> success + * return errl != nullptr -> failure */ errlHndl_t createMsgQueue(); @@ -370,8 +374,8 @@ class UtilLidMgr * the fsp. * * @return errlHndl_t - * return errl == NULL -> success - * return errl != NULL -> failure + * return errl == nullptr -> success + * return errl != nullptr -> failure */ errlHndl_t sendMboxMessage( MBOX_MSG_TYPE i_type, msg_t * i_msg ); @@ -437,11 +441,15 @@ class UtilLidMgr * @param[in] i_lidId - lid id to search for * @param[out] o_lidPnorInfo - pnor section info associated with the lid * if it exists in pnor + * @param[out] o_isLidInPnor - True if lid is in a section, false otherwise * - * @return bool - True if lid is in a section, false otherwise + * @return errlHndl_t + * return errl == nullptr -> success + * return errl != nullptr -> failure */ - bool getLidPnorSectionInfo(uint32_t i_lidId, - PNOR::SectionInfo_t &o_lidPnorInfo); + errlHndl_t getLidPnorSectionInfo(uint32_t i_lidId, + PNOR::SectionInfo_t &o_lidPnorInfo, + bool &o_isLidInPnor); /** * @brief LID fileName */ |

