Re: [PATCH v4 05/27] x86: Replace ist_enter() with nmi_enter()

Andy Lutomirski
2020-02-21T19:05:50Z

On Fri, Feb 21, 2020 at 5:50 AM Peter Zijlstra <peterz@infradead.org> wrote:
>
> A few exceptions (like #DB and #BP) can happen at any location in the
> code, this then means that tracers should treat events from these
> exceptions as NMI-like. We could be holding locks with interrupts
> disabled for instance.
>
> Similarly, #MC is an actual NMI-like exception.
>

> -dotraplinkage void notrace do_int3(struct pt_regs *regs, long error_code)
> +dotraplinkage notrace void do_int3(struct pt_regs *regs, long error_code)
> {
> if (poke_int3_handler(regs))
> return;
>
> - /*
> - * Use ist_enter despite the fact that we don't use an IST stack.
> - * We can be called from a kprobe in non-CONTEXT_KERNEL kernel
> - * mode or even during context tracking state changes.
> - *
> - * This means that we can't schedule. That's okay.
> - */
> - ist_enter(regs);
> + nmi_enter();

I agree with the change, but some commentary might be nice. Maybe