lkml.org 
[lkml]   [2020]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v4 05/27] x86: Replace ist_enter() with nmi_enter()
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
copy from here:

https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git/commit/?h=x86/idtentry&id=061eaa900b4f63601ab6381ab431fcef8dfd84be

\
 
 \ /
  Last update: 2020-02-21 20:06    [W:0.673 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site