diff options
author | Nick Bofferding <bofferdn@us.ibm.com> | 2017-10-20 21:13:34 -0500 |
---|---|---|
committer | William G. Hoffa <wghoffa@us.ibm.com> | 2017-11-03 09:45:20 -0400 |
commit | 07d75753d59419ea6ba9ee3bd930e0aa8e7e7fd5 (patch) | |
tree | 78633da60312ff8cfd54807f787219036e976621 /src/usr/errl/plugins | |
parent | 47f275a6bd3b2104a82d9786122afd6fe25f05de (diff) | |
download | talos-hostboot-07d75753d59419ea6ba9ee3bd930e0aa8e7e7fd5.tar.gz talos-hostboot-07d75753d59419ea6ba9ee3bd930e0aa8e7e7fd5.zip |
Secure Boot: Enforce PNOR section component IDs
- In secure mode, bootloader will enforce that HBB component ID is set
- In secure mode, Hostboot will enforce that PNOR component IDs are set
Change-Id: I04f3bbc45417b3229003c56e1083e1fc31c01cd7
RTC: 179422
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/48711
Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Marshall J. Wilks <mjwilks@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>
Reviewed-by: Stephen M. Cprek <smcprek@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr/errl/plugins')
-rw-r--r-- | src/usr/errl/plugins/errludparserfactoryerrl.H | 11 | ||||
-rw-r--r-- | src/usr/errl/plugins/errludstring.H | 104 |
2 files changed, 108 insertions, 7 deletions
diff --git a/src/usr/errl/plugins/errludparserfactoryerrl.H b/src/usr/errl/plugins/errludparserfactoryerrl.H index 1db49a8dc..ebe7acb47 100644 --- a/src/usr/errl/plugins/errludparserfactoryerrl.H +++ b/src/usr/errl/plugins/errludparserfactoryerrl.H @@ -58,6 +58,7 @@ public: ErrlUserDetailsParserFactoryErrl() { registerParser<ErrlUserDetailsParserString>(ERRL_UDT_STRING); + registerParser<ErrlUserDetailsParserStringSet>(ERRL_UDT_STRING_SET); registerParser<ErrlUserDetailsParserTarget>(ERRL_UDT_TARGET); registerParser<ErrlUserDetailsParserBackTrace>(ERRL_UDT_BACKTRACE); registerParser<ErrlUserDetailsParserAttribute>(ERRL_UDT_ATTRIBUTE); @@ -68,10 +69,16 @@ public: private: - // Disabled - ErrlUserDetailsParserFactoryErrl(const ErrlUserDetailsParserFactoryErrl &); + // Parser isn't compiled with c++11 in all environments, and therefore + // "delete" of unused interfaces (like below) is not supported, nor are + // functions with move semantics + + // Disable compiler provided default functions + ErrlUserDetailsParserFactoryErrl( + const ErrlUserDetailsParserFactoryErrl &); ErrlUserDetailsParserFactoryErrl & operator=( const ErrlUserDetailsParserFactoryErrl &); + }; } diff --git a/src/usr/errl/plugins/errludstring.H b/src/usr/errl/plugins/errludstring.H index 51f91d5f8..9fbd185f1 100644 --- a/src/usr/errl/plugins/errludstring.H +++ b/src/usr/errl/plugins/errludstring.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2017 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -79,14 +81,106 @@ public: } } -private: - // Disabled - ErrlUserDetailsParserString(const ErrlUserDetailsParserString &); + private: + + // Parser isn't compiled with c++11 in all environments, and therefore + // "delete" of unused interfaces (like below) is not supported, nor are + // functions with move semantics + + // Disable compiler provided default functions + ErrlUserDetailsParserString( + const ErrlUserDetailsParserString &); ErrlUserDetailsParserString & operator=( const ErrlUserDetailsParserString &); + +}; + +/** + * @class ErrlUserDetailsParserStringSet + * + * Parses string set user details from an error log + */ +class ErrlUserDetailsParserStringSet : public ErrlUserDetailsParser +{ + + public: + + /** + * @brief Constructor + */ + ErrlUserDetailsParserStringSet() + { + } + + /** + * @brief Destructor + */ + virtual ~ErrlUserDetailsParserStringSet() + { + } + + /** + * @brief Parses string set user details data from an error log + * + * @param i_version Version of the data + * @param i_parse ErrlUsrParser object for outputting information + * @param i_pBuffer Pointer to buffer containing detail data + * @param i_buflen Length of the buffer + */ + virtual void parse( + errlver_t i_version, + ErrlUsrParser& i_parser, + void* i_pBuffer, + const uint32_t i_buflen) const + { + // [Input Buffer Memory Layout] + // + // The input buffer contains N sequentially packed pairs of variable + // length, NULL terminated strings, where each string pair is also + // sequentially packed and the sum of the lengths of all such pairs + // exactly equals the input buffer length. Each string pair is + // formatted as below, beginning from either the start of the buffer or + // the end of the previous string pair: + // + // Offset Size Description + // ===================================================================== + // 0 Y NULL terminated description string describing the + // significance of the string to follow, Y=strlen(this + // string) + length (1) of NULL terminator. + // Y Z NULL terminated FFDC string, where Z=strlen(this + // string) + length (1) of NULL terminator. + + const char* pBuf = static_cast<const char*>(i_pBuffer); + const size_t len = static_cast<size_t>(i_buflen); + const char* pBufEnd = pBuf + len; + while(pBuf < pBufEnd) + { + const size_t descriptionStringSize = strlen(pBuf) + 1; + const char* const pDescriptionString = pBuf; + pBuf += descriptionStringSize; + + const size_t stringSize = strlen(pBuf) + 1; + const char* const pString = pBuf; + pBuf += stringSize; + + i_parser.PrintString(pDescriptionString,pString); + } + } + + private: + + // Parser isn't compiled with c++11 in all environments, and therefore + // "delete" of unused interfaces (like below) is not supported, nor are + // functions with move semantics + + // Disable compiler provided default functions + ErrlUserDetailsParserStringSet( + const ErrlUserDetailsParserStringSet&); + ErrlUserDetailsParserStringSet & operator=( + const ErrlUserDetailsParserStringSet&); }; -} +} // End ERRLOG namespace #endif |