Skip to content

Commit

Permalink
Set up core checkstop escalation using HWP
Browse files Browse the repository at this point in the history
This commit creates the hostboot functionality around the
p9_core_checkstop_handler HWP. At various points in the IPL when
we want to turn off unit checkstops for system checkstops, and then
later restore them, we call this HWP.

Change-Id: I6f69a9c3a88707f29e4b86e9f4e3b3bd3dfd76b7
RTC: 147565
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/56430
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>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
  • Loading branch information
e-liner authored and wghoffa committed May 22, 2018
1 parent d0eaecc commit 2a43c45
Show file tree
Hide file tree
Showing 13 changed files with 352 additions and 78 deletions.
26 changes: 0 additions & 26 deletions src/usr/isteps/istep15/host_build_stop_image.C
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,6 @@ errlHndl_t applyHcodeGenCpuRegs( TARGETING::Target *i_procChipTarg,
l_lpcrVal &= ~(0x0000000000002000) ;
l_lpcrVal |= 0x0000400000000000 ; //Allow Hyp virt to exit STOP

//@TODO RTC:147565
//Force Core Checkstops by telling ACTION1 Reg after coming out of winkle
// Core FIR Action1 Register value from Nick
// const uint64_t action1_reg = 0xEA5C139705980000;

//Get top-lvl system target with TARGETING code to find the enabled threads
TARGETING::Target* sys = NULL;
TARGETING::targetService().getTopLevelTarget(sys);
Expand Down Expand Up @@ -320,27 +315,6 @@ errlHndl_t applyHcodeGenCpuRegs( TARGETING::Target *i_procChipTarg,
{
break;
}
//@TODO RTC:147565
//Force Core Checkstops by telling ACTION1 Reg after coming out of winkle
//@fixme HACK in place for OPAL
// Need to force core checkstops to escalate to a system checkstop
// by telling the HCODE to update the ACTION1 register when it
// comes out of winkle (see HW286670)
// l_rc = p8_pore_gen_scom_fixed( io_image,
// P8_SLW_MODEBUILD_IPL,
// EX_CORE_FIR_ACTION1_0x10013107,
// l_coreId,
// action1_reg,
// P8_PORE_SCOM_REPLACE,
// P8_SCOM_SECTION_NC );
// if( l_rc )
// {
// TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
// "ERROR: ACTION1: core=0x%x,l_rc=0x%x",
// l_coreId, l_rc );
// l_failAddr = EX_CORE_FIR_ACTION1_0x10013107;
// break;
// }

} // end for l_coreIds

Expand Down
27 changes: 24 additions & 3 deletions src/usr/isteps/istep16/call_host_activate_master.C
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <errl/errludtarget.H>
#include <intr/interrupt.H>
#include <console/consoleif.H>

#include <arch/pirformat.H>
#include <arch/pvrformat.H>
#include <sys/task.h>
Expand All @@ -48,10 +47,13 @@
//SBE interfacing
#include <sbeio/sbeioif.H>
#include <sys/misc.h>
#include <pm/pm_common.H>

//Import directory (EKB)
#include <p9_block_wakeup_intr.H>

#include <scom/scomif.H>

//HWP invoker
#include <fapi2/plat_hwp_invoker.H>

Expand Down Expand Up @@ -361,8 +363,27 @@ void* call_host_activate_master (void *io_pArgs)
"Call proc_stop_deadman_timer. Target %.8X",
TARGETING::get_huid(l_proc_target) );

TARGETING::Target* sys = NULL;
TARGETING::targetService().getTopLevelTarget(sys);

// Save off original checkstop values and override them
// to disable core xstops and enable sys xstops.
l_errl = HBPM::core_checkstop_helper_hwp(l_masterCore, true);

if( l_errl )
{
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"core_checkstop_helper_hwp ERROR: returning.");
break;
}

// Take new checkstop values and insert them into the homer image
l_errl = HBPM::core_checkstop_helper_homer();

if( l_errl )
{
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"core_checkstop_helper_homer ERROR: returning.");
break;
}

} while ( 0 );

Expand Down
1 change: 1 addition & 0 deletions src/usr/isteps/istep16/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/common/utils/imageProcs/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/xip/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/common/pmlib/include/registers/
EXTRAINCDIR += ${ROOTPATH}/src/usr/isteps/

OBJS += call_host_activate_master.o
OBJS += call_host_activate_slave_cores.o
Expand Down
11 changes: 0 additions & 11 deletions src/usr/isteps/istep21/call_host_runtime_setup.C
Original file line number Diff line number Diff line change
Expand Up @@ -806,17 +806,6 @@ void* call_host_runtime_setup (void *io_pArgs)
break;
}

#if 0 //@TODO-RTC:147565-Core checkstop escalation
// Revert back to standard runtime mode where core checkstops
// do not escalate to system checkstops
// Workaround for HW286670
l_err = enableCoreCheckstops();
if ( l_err )
{
break;
}
#endif

// Fill in Hostboot runtime data for all nodes
// (adjunct partition)
// Write the HB runtime data into mainstore
Expand Down
34 changes: 34 additions & 0 deletions src/usr/isteps/istep21/call_host_start_payload.C
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <initservice/isteps_trace.H>
#include <isteps/hwpisteperror.H>
#include <isteps/istep_reasoncodes.H>
#include <pm/pm_common.H>
#include <initservice/initserviceif.H>
#include <initservice/istepdispatcherif.H>
#include <secureboot/trustedbootif.H>
Expand All @@ -50,12 +51,14 @@
#include <fapi2/target.H>
#include <fapi2/plat_hwp_invoker.H>
#include <p9n2_quad_scom_addresses_fld.H>
#include <p9_quad_scom_addresses.H>
#include <ipmi/ipmiwatchdog.H>
#include <config.h>
#include <errno.h>
#include <p9_int_scom.H>
#include <sbeio/sbeioif.H>
#include <runtime/runtime.H>
#include <p9_stop_api.H>

#ifdef CONFIG_DRTM_TRIGGERING
#include <secureboot/drtm.H>
Expand Down Expand Up @@ -290,6 +293,37 @@ void* call_host_start_payload (void *io_pArgs)
// calculate lowest addressable memory location to be used as COMM base
uint64_t l_commBase = cpu_spr_value(CPU_SPR_HRMOR) - VMM_HRMOR_OFFSET;

// About to call shutdown, if we're running on a PHYP system, we need
// to switch back to running unit checkstops
if(! is_sapphire_load() )
{
TARGETING::TargetHandleList l_coreTargetList;
getAllChips(l_coreTargetList, TYPE_CORE);

for( auto l_core_target : l_coreTargetList)
{
l_errl = HBPM::core_checkstop_helper_hwp( l_core_target,
false);

if(l_errl)
{
TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace,
"p9_core_checkup_handler_hwp ERROR : Returning "
"errorlog, reason=0x%x",l_errl->reasonCode() );

// capture the target data in the elog
ErrlUserDetailsTarget(l_core_target).addToLog( l_errl );

break;
}
}
}

if(l_errl)
{
break;
}

// - Call shutdown using payload base, and payload entry.
// - base/entry will be from system attributes
// - this will start the payload (Phyp)
Expand Down
3 changes: 3 additions & 0 deletions src/usr/isteps/istep21/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,18 @@
# IBM_PROLOG_END_TAG
ROOTPATH = ../../../..
MODULE = istep21
PROCEDURES_PATH = ${ROOTPATH}/src/import/chips/p9/procedures

EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/common/include/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/pm/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/initfiles/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/ffdc/
EXTRAINCDIR += ${PROCEDURES_PATH}/utils/stopreg/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/common/utils/imageProcs/
EXTRAINCDIR += ${ROOTPATH}/src/import/hwpf/fapi2/include/
EXTRAINCDIR += ${ROOTPATH}/src/include/usr/fapi2/
EXTRAINCDIR += ${ROOTPATH}/src/usr/isteps/

OBJS += call_host_runtime_setup.o
OBJS += freqAttrData.o
Expand Down
10 changes: 6 additions & 4 deletions src/usr/isteps/istepHelperFuncs.C
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#include <trace/interface.H>
#include <errl/errlentry.H>

#include <errl/errlmanager.H>
#include <isteps/hwpisteperror.H>
#include <errl/errludtarget.H>
#include <errl/errlmanager.H>
Expand All @@ -42,6 +42,11 @@
#include <util/align.H>
#include <util/algorithm.H>

using namespace ISTEP;
using namespace ISTEP_ERROR;
using namespace TARGETING;
using namespace ERRORLOG;

//
// Helper function to set _EFF_CONFIG attributes for HWPs
//
Expand Down Expand Up @@ -318,6 +323,3 @@ void captureError(errlHndl_t &io_err,
} // end if ( i_err )
}




2 changes: 0 additions & 2 deletions src/usr/isteps/istepHelperFuncs.H
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,12 @@ enum MSS_PROGRAM_TYPE
DEFAULT_TYPE = 3,
};


//
// Helper function to set _EFF_CONFIG attributes for HWPs
//
void set_eff_config_attrs_helper( const EFF_CONFIG_ATTRIBUTES_BASE i_base,
bool & o_post_dram_inits_found);


/**
* @brief Compares two mcbist targets based on the voltage domain ID for
* the voltage domain given by the template parameter. Used for sorting
Expand Down
22 changes: 14 additions & 8 deletions src/usr/isteps/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
# IBM_PROLOG_END_TAG
ROOTPATH=../../..
MODULE = isteps
PROCEDURES_PATH = ${ROOTPATH}/src/import/chips/p9/procedures

SUBDIRS+=istep06.d
SUBDIRS+=istep07.d
Expand All @@ -50,21 +51,26 @@ SUBDIRS+=fab_iovalid.d
SUBDIRS+=nest.d
SUBDIRS+=io.d

OBJS += hwpisteperror.o
OBJS += hwpistepud.o
OBJS += istepHelperFuncs.o
OBJS += pbusLinkSvc.o

#TODO: RTC 176018
EXTRAINCDIR += ${ROOTPATH}/src/import/

OBJS += $(if $(CONFIG_OPENPOWER_VOLTMSG),openpower_vddr.o,hbToHwsvVoltageMsg.o)

EXTRAINCDIR += ${PROCEDURES_PATH}/hwp/perv/
EXTRAINCDIR += ${PROCEDURES_PATH}/utils/stopreg/
EXTRAINCDIR += ${ROOTPATH}/src/include/usr/isteps/pm/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/common/include/
EXTRAINCDIR += ${ROOTPATH}/src/usr/initservice/istepdispatcher
EXTRAINCDIR += ${ROOTPATH}/src/import/hwpf/fapi2/include/
EXTRAINCDIR += ${ROOTPATH}/src/include/usr/fapi2/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/utils/imageProcs/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/common/utils/imageProcs/
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/ffdc/

OBJS += hwpisteperror.o
OBJS += hwpistepud.o
OBJS += istepHelperFuncs.o
OBJS += pbusLinkSvc.o

OBJS += $(if $(CONFIG_OPENPOWER_VOLTMSG),openpower_vddr.o,hbToHwsvVoltageMsg.o)

include ${ROOTPATH}/procedure.rules.mk
include ${ROOTPATH}/config.mk

4 changes: 2 additions & 2 deletions src/usr/isteps/pm/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2016
# Contributors Listed Below - COPYRIGHT 2016,2018
# [+] International Business Machines Corp.
#
#
Expand All @@ -29,7 +29,7 @@ MODULE = pm
SUBDIRS+=runtime.d

## Objects unique to HB IPL

OBJS += ../istepHelperFuncs.o
## Objects common to HB IPL and HBRT
include pm.mk

Expand Down
3 changes: 3 additions & 0 deletions src/usr/isteps/pm/pm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/xip
HWP_LIB_PATH += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/lib/
HWP_PM_PATH += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/pm
EXTRAINCDIR += ${HWP_PM_PATH}
EXTRAINCDIR += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/perv
HWP_STOPUTIL_PATH += ${ROOTPATH}/src/import/chips/p9/procedures/utils/stopreg/
EXTRAINCDIR += ${HWP_STOPUTIL_PATH}
NEST_UTIL_PATH += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/nest
Expand Down Expand Up @@ -70,6 +71,7 @@ OBJS += p9_avsbus_lib.o
VPATH += ${HWP_PM_PATH} ${HWP_CUST_PATH} ${HWP_ACC_PATH}
VPATH += ${HWP_LIB_PATH} ${HWP_STOPUTIL_PATH}
VPATH += ${NEST_UTIL_PATH}
VPATH += ${ROOTPATH}/src/import/chips/p9/procedures/hwp/perv/

# TODO RTC: 164237
# Take another look at PM lib
Expand Down Expand Up @@ -114,3 +116,4 @@ include ${HWP_PM_PATH}/p9_pm_recovery_ffdc_qppm.mk
include ${HWP_PM_PATH}/p9_pm_recovery_ffdc_occ.mk
include ${HWP_PM_PATH}/p9_cme_sram_access.mk
include ${HWP_PM_PATH}/p9_pm_callout.mk
include ${ROOTPATH}/src/import/chips/p9/procedures/hwp/perv/p9_core_checkstop_handler.mk

0 comments on commit 2a43c45

Please sign in to comment.