From c3d65931f9e90d985a2c2ae4060ab3ad8e82b48d Mon Sep 17 00:00:00 2001 From: Corey Swenson Date: Mon, 16 Dec 2019 00:16:47 -0600 Subject: Fix for missing HBRT error log after error injected An HBRT error log larger than 4K sent to the host will be truncated to 4K before it reaches HWSV, where a size mismatch prevents processing of the log. To avoid this, truncate the HBRT log to 4K before sending across interface to host. Change-Id: Ic2c354da99c0a4ccec00ce58cf6ef34bc02e7996 CQ:SW480758 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/88724 Reviewed-by: Matt Derksen Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Roland Veloz Reviewed-by: Daniel M Crowell --- src/usr/errl/runtime/rt_errlmanager.C | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/usr/errl/runtime/rt_errlmanager.C') diff --git a/src/usr/errl/runtime/rt_errlmanager.C b/src/usr/errl/runtime/rt_errlmanager.C index 9fb624608..e545641bb 100644 --- a/src/usr/errl/runtime/rt_errlmanager.C +++ b/src/usr/errl/runtime/rt_errlmanager.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2018 */ +/* Contributors Listed Below - COPYRIGHT 2013,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -47,6 +47,8 @@ uint8_t ErrlManager::iv_hiddenErrLogsEnable = extern trace_desc_t* g_trac_errl; +// Maximum size of error log that can be sent to the host +const uint32_t MAX_FSP_ERROR_LOG_LENGTH = 4096; ////////////////////////////////////////////////////////////////////////////// @@ -188,10 +190,14 @@ void ErrlManager::sendMboxMsg ( errlHndl_t& io_err ) if(g_hostInterfaces) { uint32_t l_msgSize = io_err->flattenedSize(); + if (l_msgSize > MAX_FSP_ERROR_LOG_LENGTH) + { + l_msgSize = MAX_FSP_ERROR_LOG_LENGTH; + } if (g_hostInterfaces->sendErrorLog) { uint8_t * temp_buff = new uint8_t [l_msgSize ]; - io_err->flatten ( temp_buff, l_msgSize ); + io_err->flatten ( temp_buff, l_msgSize, true /* truncate */ ); size_t rc = g_hostInterfaces->sendErrorLog(io_err->plid(), l_msgSize, -- cgit v1.2.1