[lkml]   [2019]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v3 6/6] x86/entry/64: Remove TRACE_IRQS_*_DEBUG
On Thu, Jul 11, 2019 at 4:51 AM Peter Zijlstra <> wrote:
> Since INT3/#BP no longer runs on an IST, this workaround is no longer
> required.
> Tested by running lockdep+ftrace as described in the initial commit:
> 5963e317b1e9 ("ftrace/x86: Do not change stacks in DEBUG when calling lockdep")
> Reviewed-by: Steven Rostedt (VMware) <>
> Signed-off-by: Peter Zijlstra (Intel) <>

I would definitely like to see this happen, but there are all kinds of
possibly nasties here. Ideally we'd like get rid of IST for #DB, but
we can't due to the MOV SS mess. There are a few relevant cases we
care about:

#DB from user mode -> anything that hits in C code: irrelevant --
we've exited the IST stack already.

#DB from user mode -> NMI/MCE in the asm -> #DB: The NMI code tries to
get this right. The MCE code does not.

#DB from kernel mode -> NMI/MCE -> #DB: same as above.

MOV SS -> #DB from entry -> #DB again: ugh. We get some protection
from shift_ist.

IMO we would ideally just clear DR7 in sensitive contexts. Or extend
the debug_stack_set_zero(), etc hack.

All that being said, the actual _DEBUG macros shouldn't matter here, I
think. But I'd like to sleep on it. So not-yet-acked-by me.

 \ /
  Last update: 2019-07-11 16:47    [W:0.069 / U:0.668 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site