Re: [RFC][PATCH 3/3] x86: Add workaround to NMI iret woes

From: Steven Rostedt
Date: Thu Dec 08 2011 - 14:36:57 EST


On Thu, 2011-12-08 at 14:30 -0500, Steven Rostedt wrote:

> If the first NMI hits a breakpoint and loses NMI context, and then it
> hits another breakpoint and while processing that breakpoint we get a
> nested NMI. When processing a breakpoint, the stack changes to the
> breakpoint stack. If another NMI comes in here we can't rely on the
> interrupted stack to be the NMI stack.

As I wrote this part of the change log, I thought of another nasty
gotcha with breakpoints in NMIs.

If you have a breakpoint in both normal context and NMI context. When
the breakpoint is being processed, if an NMI comes in and it too
triggers a breakpoint, this processing of the breakpoint has the same
problem as nested NMIs. The NMI breakpoint handler will corrupt the
stack of the breakpoint that was being processed when the NMI triggered.

I'm not sure how to handle this case. We could do something similar in
the break point code to handle the same thing. But this just seems
really ugly.

Anyone with any better ideas?

-- Steve


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/