[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrWYZHhP80PBxOcm5sc=p=StUbuwdvjDj-E3ma7wi3w-Pg@mail.gmail.com>
Date: Thu, 11 Jul 2019 07:45:56 -0700
From: Andy Lutomirski <luto@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Borislav Petkov <bp@...en8.de>, Ingo Molnar <mingo@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>,
Andrew Lutomirski <luto@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
"H. Peter Anvin" <hpa@...or.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Juergen Gross <jgross@...e.com>,
LKML <linux-kernel@...r.kernel.org>,
He Zhe <zhe.he@...driver.com>,
Joel Fernandes <joel@...lfernandes.org>, devel@...ukata.com
Subject: Re: [PATCH v3 6/6] x86/entry/64: Remove TRACE_IRQS_*_DEBUG
On Thu, Jul 11, 2019 at 4:51 AM Peter Zijlstra <peterz@...radead.org> 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) <rostedt@...dmis.org>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
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.
Powered by blists - more mailing lists