Re: Dealing with the NMI mess

From: Peter Zijlstra
Date: Fri Jul 24 2015 - 15:55:17 EST


On Fri, Jul 24, 2015 at 11:29:29AM -0700, Linus Torvalds wrote:
> On Fri, Jul 24, 2015 at 8:30 AM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> > On Fri, Jul 24, 2015 at 05:26:37PM +0200, Willy Tarreau wrote:
> >> >
> >> > The point is, if we trigger a #DB on an instruction breakpoint
> >> > while !IF, then we simply disable that breakpoint and do the RET.
> >>
> >> Yes but the breakpoint remains disabled then. Or I'm missing
> >> something.
> >
> > http://marc.info/?l=linux-kernel&m=143773601130974
> >
> > We re-enable before going back to userspace.
>
> Actually, Andy had a good argument that we don't even need this.
>
> We just don't ever need to disable data breakpoints. Even if we end up doing
>
> cli();
> copy_from_user_inatomic();
>
> that actually works fine. If there are data breakpoints, we will have

I worry that we'll end up running the do_debug() handlers from effective
NMI context.

The NMI might have preempted locks which these handlers require etc..
--
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/