From 3d7aee811e82959c8f250ce8190ffb739280f6ee Mon Sep 17 00:00:00 2001 From: Roland Veloz Date: Tue, 27 Feb 2018 23:51:45 -0600 Subject: Inform OPAL of the state of the SBE after an attempt to restart Inform OPAL of the state of the SBE after an attempt to restart, either it is disabled or enabled after retry, along with the processor ID of the SBE. Change-Id: I66a58e866c602c53f41f7cdfbd798f613d3b4dab RTC:180245 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/54813 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Martin Gloff Reviewed-by: Christian R. Geddes Reviewed-by: Daniel M. Crowell --- src/usr/sbeio/common/sbe_attn.C | 28 ++++++++- src/usr/sbeio/runtime/makefile | 1 + src/usr/sbeio/runtime/sbeio_vital_attn.C | 97 ++++++++++++++++++++++++++++++++ 3 files changed, 124 insertions(+), 2 deletions(-) create mode 100644 src/usr/sbeio/runtime/sbeio_vital_attn.C (limited to 'src/usr/sbeio') diff --git a/src/usr/sbeio/common/sbe_attn.C b/src/usr/sbeio/common/sbe_attn.C index a6fcb0583..5ad8152e1 100644 --- a/src/usr/sbeio/common/sbe_attn.C +++ b/src/usr/sbeio/common/sbe_attn.C @@ -36,6 +36,9 @@ #include #include #include +#include +#include +#include extern trace_desc_t* g_trac_sbeio; @@ -57,6 +60,16 @@ namespace SBEIO TRACFCOMP( g_trac_sbeio, "handleVitalAttn> Returned SBE PLID=0x%x", l_sbePlid); +#ifdef __HOSTBOOT_RUNTIME + // Inform OPAL, SBE is currently disabled + if (TARGETING::is_sapphire_load()) + { + // Inform OPAL of the inoperable SBE + l_errhdl = RT_SBEIO::vital_attn_inform_opal(i_procTarg, + RT_SBEIO::SBE_DISABLED); + } +#endif + // @todo - RTC:180242 - Restart SBE SbeRetryHandler l_sbeObj = SbeRetryHandler( @@ -68,8 +81,19 @@ namespace SBEIO l_sbeObj.main_sbe_handler(i_procTarg); - // @todo - RTC:180244 - Disable the OCC - // @todo - RTC:180245 - Inform OPAL +#ifdef __HOSTBOOT_RUNTIME + // Inform OPAL the state of the SBE after a retry + if (l_sbeObj.getSbeRestart()) + { + if (TARGETING::is_sapphire_load()) + { + l_errhdl = RT_SBEIO::vital_attn_inform_opal(i_procTarg, + RT_SBEIO::SBE_ENABLED); + } + + // @todo - RTC:180244 - Disable the OCC + } +#endif TRACFCOMP( g_trac_sbeio, EXIT_MRK "handleVitalAttn> "); diff --git a/src/usr/sbeio/runtime/makefile b/src/usr/sbeio/runtime/makefile index 13fbaed12..541ad0b77 100644 --- a/src/usr/sbeio/runtime/makefile +++ b/src/usr/sbeio/runtime/makefile @@ -47,6 +47,7 @@ EXTRAINCDIR += ${PROCEDURES_PATH}/hwp/sbe/ ## Objects unique to HBRT OBJS += rt_sbeio.o OBJS += sbeio_attr_override.o +OBJS += sbeio_vital_attn.o OBJS += ${SBEIO_COMMON_OBJS} VPATH += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/perv/ diff --git a/src/usr/sbeio/runtime/sbeio_vital_attn.C b/src/usr/sbeio/runtime/sbeio_vital_attn.C new file mode 100644 index 000000000..8498d2c61 --- /dev/null +++ b/src/usr/sbeio/runtime/sbeio_vital_attn.C @@ -0,0 +1,97 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/sbeio/runtime/sbeio_vital_attn.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2018 */ +/* [+] 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. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +#include + +#include // g_hostInterfaces +#include // firmware_request_helper +#include // SBEIO_HANDLE_VITAL_ATTN + +extern trace_desc_t* g_trac_sbeio; + +using namespace ERRORLOG; +using namespace SBEIO; +using namespace TARGETING; + +namespace RT_SBEIO +{ + //------------------------------------------------------------------------ + errlHndl_t vital_attn_inform_opal(TARGETING::TargetHandle_t i_procTarg, + SBE_STATE i_sbeState) + { + errlHndl_t l_err = nullptr; + do + { + if ((nullptr == g_hostInterfaces) || + (nullptr == g_hostInterfaces->firmware_request)) + { + TRACFCOMP( g_trac_sbeio, ERR_MRK"handleVitalAttn: " + "Hypervisor firmware_request interface not linked"); + + /*@ + * @errortype + * @severity ERRL_SEV_INFORMATIONAL + * @moduleid SBEIO_RUNTIME_HANDLE_VITAL_ATTN + * @reasoncode SBEIO_RT_NULL_FIRMWARE_REQUEST_PTR + * @userdata1 HUID of target + * @userdata2 none + * @devdesc Unable to inform OPAL of SBE failure + */ + l_err = new ErrlEntry( ERRL_SEV_INFORMATIONAL, + SBEIO_RUNTIME_HANDLE_VITAL_ATTN, + SBEIO_RT_NULL_FIRMWARE_REQUEST_PTR, + get_huid(i_procTarg), + 0, true); + break; + } + + // Create the firmware_request request struct to send data + hostInterfaces::hbrt_fw_msg l_req_fw_msg; + uint64_t l_req_fw_msg_size = sizeof(l_req_fw_msg); + memset(&l_req_fw_msg, 0, l_req_fw_msg_size); + + // Populate the firmware_request request struct with given data + l_req_fw_msg.io_type = + hostInterfaces::HBRT_FW_MSG_TYPE_SBE_STATE; + l_req_fw_msg.sbe_state.i_procId = + i_procTarg->getAttr(); + l_req_fw_msg.sbe_state.i_state = i_sbeState; + + // Create the firmware_request response struct to receive data + hostInterfaces::hbrt_fw_msg l_resp_fw_msg; + uint64_t l_resp_fw_msg_size = sizeof(l_resp_fw_msg); + memset(&l_resp_fw_msg, 0, l_resp_fw_msg_size); + + // Make the firmware_request call + l_err = firmware_request_helper(l_req_fw_msg_size, + &l_req_fw_msg, + &l_resp_fw_msg_size, + &l_resp_fw_msg); + } + while(0); + + return l_err; + } // end errlHndl_t vital_attn_inform_opal(...) + +} // end namespace RT_SBEIO -- cgit v1.2.1