diff options
author | Dan Crowell <dcrowell@us.ibm.com> | 2017-10-01 16:09:56 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-03-29 12:03:50 -0400 |
commit | 90eaed6f430c88eb0127ce47671bd80b21f35433 (patch) | |
tree | 9bc4aaa5cfb416f0da69386fb595e92513e0d1b7 /src/include | |
parent | 284cebd97cf08d42ba2f4caa8779bf47494fcc20 (diff) | |
download | talos-hostboot-90eaed6f430c88eb0127ce47671bd80b21f35433.tar.gz talos-hostboot-90eaed6f430c88eb0127ce47671bd80b21f35433.zip |
Force checkstops for unhandled machine checks
Default MSR[ME]=0 during initial boot for bootloader and
hostboot kernel
Once the xscom address range has been mapped in, enable the
machine check handler to force a checkstop and set MSR[ME]=1
to allow regular machine check handling
CQ: SW401402
Change-Id: I104e39465e61b3b19d5c073e71271102711ae54f
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/47179
Reviewed-by: Christian R. Geddes <crgeddes@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: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/kernel/machchk.H | 32 | ||||
-rw-r--r-- | src/include/kernel/syscalls.H | 5 | ||||
-rw-r--r-- | src/include/sys/misc.h | 12 | ||||
-rw-r--r-- | src/include/usr/xscom/xscomif.H | 11 |
4 files changed, 56 insertions, 4 deletions
diff --git a/src/include/kernel/machchk.H b/src/include/kernel/machchk.H index af4243807..aebef6235 100644 --- a/src/include/kernel/machchk.H +++ b/src/include/kernel/machchk.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,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. */ @@ -43,6 +45,34 @@ namespace Kernel * @return bool - True if MC successfully handled, false otherwise. */ bool handleSLB(task_t* t); + + /** + * Constants to define the FIR bit to use to force a checkstop + * for an unhandled machine check. + */ +#ifdef CONFIG_P9_SYSTEM + constexpr uint64_t MCHK_XSTOP_FIR_SCOM_ADDR = 0x05012000; + constexpr uint64_t MCHK_XSTOP_FIR_VALUE = 0x0000000100000000ull;//31 +#endif + + /** @fn setCheckstopData + * @brief Tells the kernel how to force a checkstop for unrecoverable + * machine checks + * @param[in] i_xstopAddr - XSCOM MMIO address of FIR to write + * @param[in] i_xstopData - Data to write into FIR to trigger xstop + * + * @return none + */ + void setCheckstopData(uint64_t i_xstopAddr, + uint64_t i_xstopData); + + /** @fn forceCheckstop + * @brief Force a checkstop if we know how in order to get better + * error isolation for cache/memory UEs + * + * @return none + */ + void forceCheckstop(); } } diff --git a/src/include/kernel/syscalls.H b/src/include/kernel/syscalls.H index 35c6a5fe8..c7a03d6b6 100644 --- a/src/include/kernel/syscalls.H +++ b/src/include/kernel/syscalls.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2010,2017 */ +/* Contributors Listed Below - COPYRIGHT 2010,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -123,6 +123,9 @@ namespace Systemcalls /** critassert() */ MISC_CRITASSERT, + /** set_mchk_data() */ + MISC_SETMCHKDATA, + SYSCALL_MAX }; diff --git a/src/include/sys/misc.h b/src/include/sys/misc.h index 6b57e7e4e..af44d7ce8 100644 --- a/src/include/sys/misc.h +++ b/src/include/sys/misc.h @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2017 */ +/* Contributors Listed Below - COPYRIGHT 2011,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -248,6 +248,16 @@ int cpu_all_winkle(); */ void cpu_crit_assert(uint64_t i_failAddr); +/** @fn set_mchk_data + * @brief Tells the kernel how to force a checkstop for unrecoverable + * machine checks + * @param[in] i_xstopAddr - XSCOM MMIO address of FIR to write + * @param[in] i_xstopData - Data to write into FIR to trigger xstop + * + * @return none + */ +void set_mchk_data(uint64_t i_xstopAddr, uint64_t i_xstopData); + #ifdef __cplusplus } #endif diff --git a/src/include/usr/xscom/xscomif.H b/src/include/usr/xscom/xscomif.H index 1afdfafcb..65b7410f1 100644 --- a/src/include/usr/xscom/xscomif.H +++ b/src/include/usr/xscom/xscomif.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2017 */ +/* Contributors Listed Below - COPYRIGHT 2017,2018 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -34,6 +34,15 @@ namespace XSCOM */ uint64_t get_master_bar( void ); +/** + * @brief Generate a fully-qualified MMIO address for a physical scom + * address, relative to the given processor target + * @param[in] i_proc - Processor + * @param[in] i_scomAddr - Physical scom address to convert + * @return uint64_t - MMIO address + */ +uint64_t generate_mmio_addr( TARGETING::Target* i_proc, + uint64_t i_scomAddr ); }; // namespace XSCOM |