Commit 82f9c84e authored by Philippe Gerum's avatar Philippe Gerum
Browse files

evl/thread: do not switch stage in trap over NMI context



We cannot safely run the stage switching machinery while running in
NMI context.
Signed-off-by: default avatarPhilippe Gerum <rpm@xenomai.org>
parent 5e996646
......@@ -1518,6 +1518,13 @@ void handle_oob_trap_entry(unsigned int trapnr, struct pt_regs *regs)
trace_evl_thread_fault(trapnr, regs);
/*
* We may not demote the current task if running in NMI
* context. Just bail out if so.
*/
if (in_nmi())
return;
curr = evl_current();
if (curr->local_info & T_INFAULT) {
note_trap(curr, trapnr, regs, "recursive fault");
......@@ -1546,6 +1553,9 @@ void handle_oob_trap_exit(unsigned int trapnr, struct pt_regs *regs)
{
struct evl_thread *curr = evl_current();
if (in_nmi())
return;
hard_local_irq_enable();
curr->local_info &= ~T_INFAULT;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment