diff options
author | Matt Raybuck <mraybuc@us.ibm.com> | 2018-08-28 10:08:52 -0500 |
---|---|---|
committer | William G. Hoffa <wghoffa@us.ibm.com> | 2018-09-07 08:45:10 -0500 |
commit | 30603769812267f6c947357fce6a6edff50e27d2 (patch) | |
tree | 430381b6924218cd40289b68d6467b9df8c22160 /src/usr | |
parent | e867f7fa67bedd7c1d19a4b11c781bb70bdb3daf (diff) | |
download | talos-hostboot-30603769812267f6c947357fce6a6edff50e27d2.tar.gz talos-hostboot-30603769812267f6c947357fce6a6edff50e27d2.zip |
Add VERSION to all OpenPOWER error logs
When an error log is created for OpenPOWER systems
it didn't contain the VERSION info within it. This
commit adds a function called AddVersionInfo() that
appends the VERSION info to every error log for
OpenPOWER.
Change-Id: Ic259e10e942f6df0675055823e4945ef9696b659
RTC: 196794
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/65506
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Reviewed-by: ILYA SMIRNOV <ismirno@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: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/errl/errlentry.C | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/src/usr/errl/errlentry.C b/src/usr/errl/errlentry.C index b5df8a071..850d8d7ec 100644 --- a/src/usr/errl/errlentry.C +++ b/src/usr/errl/errlentry.C @@ -665,6 +665,103 @@ void ErrlEntry::addHbBuildId() ErrlUserDetailsString(l_pString).addToLog(this); } +void ErrlEntry::addVersionInfo() +{ + // Version section of PNOR is only available to OpenPOWER systems. + if (!INITSERVICE::spBaseServicesEnabled()) + { + //TODO: CQ:SW416159 Uncomment when merged + // bool l_secureSectionLoaded = false; + errlHndl_t l_errl = nullptr/*, l_errl_loadSecureSection = nullptr*/; + + do + { +/* TODO: CQ:SW416159 Uncomment when merged +#ifdef CONFIG_SECUREBOOT + l_errl_loadSecureSection = PNOR::loadSecureSection(PNOR::VERSION); + if (l_errl_loadSecureSection) + { + TRACFCOMP( g_trac_errl, + "addVersionInfo: Failed to load secure VERSION"); + // Since an error occurred while attempting to add version info + // to another error log there is nothing that can be done with + // this error since attempting to commit it will lead to an + // infinite loop of committing the error and then recalling this + // function. If this error occurred then the VERSION partition + // is not added and the error log commit continues. + delete l_errl_loadSecureSection; + l_errl_loadSecureSection = nullptr; + break; + } + else + { + l_secureSectionLoaded = true; + } +#endif +*/ + // Get PNOR Version + PNOR::SectionInfo_t l_pnorVersionInfo; + l_errl = getSectionInfo(PNOR::VERSION, l_pnorVersionInfo); + + if (l_errl) + { + TRACFCOMP( g_trac_errl, + "addVersionInfo: Failed to getSectionInfo"); + // Since an error occurred while attempting to add version info + // to another error log there is nothing that can be done with + // this error since attempting to commit it will lead to an + // infinite loop of committing the error and then recalling this + // function. If this error occurred then the VERSION partition + // is not added and the error log commit continues. + delete l_errl; + l_errl = nullptr; + break; + } + + const uint8_t* l_versionData = + reinterpret_cast<uint8_t*>(l_pnorVersionInfo.vaddr); + + size_t l_numberOfBytes = 0; + + // Determine the size of the version data. + while ((static_cast<char>(l_versionData[l_numberOfBytes]) != '\0') + && l_numberOfBytes < l_pnorVersionInfo.size) + { + ++l_numberOfBytes; + } + + char l_pVersionString[l_numberOfBytes + 1]={0}; + + memcpy(l_pVersionString, l_versionData, l_numberOfBytes); + + ErrlUserDetailsString(l_pVersionString).addToLog(this); + } while(0); + +/* TODO: CQ:SW416159 Uncomment when merged +#ifdef CONFIG_SECUREBOOT + if (l_secureSectionLoaded) + { + l_errl_loadSecureSection = PNOR::unloadSecureSection(PNOR::VERSION); + if(l_errl_loadSecureSection) + { + TRACFCOMP( g_trac_errl, + "addVersionInfo: Failed to unload secure VERSION"); + // Since an error occurred while attempting to add version info + // to another error log there is nothing that can be done with + // this error since attempting to commit it will lead to an + // infinite loop of committing the error and then recalling this + // function. If this error occurred then the VERSION partition + // is not added and the error log commit continues. + delete l_errl_loadSecureSection; + l_errl_loadSecureSection = nullptr; + } + } +#endif +*/ + } + +} + enum { SKIP_INFO_RECOVERABLE_LOGS = TARGETING::HIDDEN_ERRLOGS_ENABLE_NO_HIDDEN_LOGS, @@ -896,6 +993,9 @@ void ErrlEntry::commit( compId_t i_committerComponent ) // Add the Hostboot Build ID to the error log addHbBuildId(); + // Add the version info to the error log for OpenPOWER systems + addVersionInfo(); + // check to see if we should skip info and recoverable errors? checkHiddenLogsEnable(); |