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/kernel/machchk.C | |
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/kernel/machchk.C')
-rw-r--r-- | src/kernel/machchk.C | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/kernel/machchk.C b/src/kernel/machchk.C index 79edf4240..2a96b5896 100644 --- a/src/kernel/machchk.C +++ b/src/kernel/machchk.C @@ -27,12 +27,20 @@ #include <kernel/vmmmgr.H> #include <sys/mmio.h> #include <arch/memorymap.H> +#include <arch/ppc.H> namespace Kernel { namespace MachineCheck { +//Keep track of the MMIO address that we can use to force a checkstop +static uint64_t* g_xstopRegPtr = nullptr; + +//Keep track of the data to write into the xstop reg +static uint64_t g_xstopRegValue = 0; + + bool handleLoadUE(task_t* t) { bool handled = false; @@ -132,5 +140,42 @@ bool handleSLB(task_t* t) } +/** + * @brief Tells the kernel how to force a checkstop for unrecoverable + * machine checks + */ +void setCheckstopData(uint64_t i_xstopAddr, uint64_t i_xstopData) +{ + g_xstopRegPtr = reinterpret_cast<uint64_t*>(i_xstopAddr + |VmmManager::FORCE_PHYS_ADDR); + g_xstopRegValue = i_xstopData; + printk( "Set MchChk Xstop: %p=%.16lX\n", g_xstopRegPtr, g_xstopRegValue ); + + // Now that the machine check handler can do the xscom we + // can set MSR[ME]=1 to enable the regular machine check + // handling + uint64_t l_msr = getMSR(); + l_msr |= 0x0000000000001000; //set bit 51 + setMSR(l_msr); +} + +/** + * @brief Force a checkstop if we know how in order to get better + * error isolation for cache/memory UEs + */ +void forceCheckstop() +{ + if( g_xstopRegPtr != nullptr ) + { + printk( "Forcing a xstop with %p = %.16lX\n", + g_xstopRegPtr, g_xstopRegValue ); + *g_xstopRegPtr = g_xstopRegValue; + } + else + { + printk( "Unable to force checkstop, No xstop reg set\n" ); + } +} + } } |