Skip to content

Commit

Permalink
Fix deadlock in ECC error shutdown path
Browse files Browse the repository at this point in the history
There is a scenario wherein if a PNOR ECC UE occurs when attempting to service a
page fault, the kernel will deadlock when it attempts to kill the task that
triggered the fault.  This is due to the kill routine being called while holding
the VMM spinlock and then collecting a backtrace, which also performs
a nested acquire of the same spinlock.  This fix inhibits invoking the
backtrace if the kill routine holds the VMM spinlock.

Change-Id: I75bf1f248740a08fd485379d88e146096edf65a9
CQ: SW461429
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/75264
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: Ilya Smirnov <ismirno@us.ibm.com>
Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com>
Reviewed-by: Matthew Raybuck <matthew.raybuck@ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
  • Loading branch information
Nick Bofferding authored and wghoffa committed Apr 1, 2019
1 parent f55c462 commit de2312a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/include/kernel/vmmmgr.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2010,2018 */
/* Contributors Listed Below - COPYRIGHT 2010,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -298,6 +298,7 @@ class VmmManager
public:
friend class Block;
friend class StackSegment;
friend class MessageHandler;

};

Expand Down
9 changes: 7 additions & 2 deletions src/kernel/msghandler.C
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <kernel/console.H>
#include <kernel/doorbell.H>
#include <kernel/misc.H>

#include <kernel/vmmmgr.H>

void MessageHandler::sendMessage(msg_sys_types_t i_type, void* i_key,
void* i_data, task_t* i_task)
Expand Down Expand Up @@ -186,7 +186,12 @@ int MessageHandler::recvMessage(msg_t* i_msg)
printk("Unhandled msg rc %d (%s) for key %p on task %d @ %p\n",
msg_rc, ErrnoToString(msg_rc), key, deferred_task->tid,
deferred_task->context.nip);
KernelMisc::printkBacktrace(deferred_task);
// Kernel will deadlock if the message handler has the VMM spinlock
// locked and then attempts to print the backtrace
if(VmmManager::getLock() != iv_lock)
{
KernelMisc::printkBacktrace(deferred_task);
}
MAGIC_INSTRUCTION(MAGIC_BREAK_ON_ERROR);
endTaskList.insert(deferred_task);
}
Expand Down

0 comments on commit de2312a

Please sign in to comment.