[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrUyA5bN2ScrdhwEYZSUpyOhO+MaEu1X3PwX6vHGGCkqCg@mail.gmail.com>
Date: Wed, 13 May 2020 21:37:10 -0700
From: Andy Lutomirski <luto@...nel.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>, X86 ML <x86@...nel.org>,
"Paul E. McKenney" <paulmck@...nel.org>,
Andy Lutomirski <luto@...nel.org>,
Alexandre Chartre <alexandre.chartre@...cle.com>,
Frederic Weisbecker <frederic@...nel.org>,
Paolo Bonzini <pbonzini@...hat.com>,
Sean Christopherson <sean.j.christopherson@...el.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
Petr Mladek <pmladek@...e.com>,
Steven Rostedt <rostedt@...dmis.org>,
Joel Fernandes <joel@...lfernandes.org>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Juergen Gross <jgross@...e.com>,
Brian Gerst <brgerst@...il.com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Will Deacon <will@...nel.org>
Subject: Re: [patch V4 part 3 13/29] x86/traps: Prepare for using DEFINE_IDTENTRY
On Tue, May 5, 2020 at 7:15 AM Thomas Gleixner <tglx@...utronix.de> wrote:
>
> From: Thomas Gleixner <tglx@...utronix.de>
>
> Prepare for using IDTENTRY to define the C exception/trap entry points. It
> would be possible to glue this into the existing macro maze, but it's
> simpler and better to read at the end to just make them distinct. Provide
> a trivial inline helper to read the trap address.
>
> The existing macros will be removed once all instances are converted.
>
> Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
> Reviewed-by: Alexandre Chartre <alexandre.chartre@...cle.com>
>
> ---
> arch/x86/kernel/traps.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> --- a/arch/x86/kernel/traps.c
> +++ b/arch/x86/kernel/traps.c
> @@ -205,6 +205,11 @@ static void do_error_trap(struct pt_regs
> }
> }
>
> +static __always_inline void __user *error_get_trap_addr(struct pt_regs *regs)
> +{
> + return (void __user *)uprobe_get_trap_addr(regs);
> +}
My mind boggles. WTF is this?
Perhaps this should have a comment like:
/*
* Returns the address from which a user trap originated. This would
be the same as regs->ip,
* except for frhgnieawfn nvlrkvklsrvs and mfkealwf, and this lets the
thingummy pass a
* modified value to the signal frame, but only for #DE and #UD,
because #*!&@&#@.
*/
except with the blanks filled in.
After reading a bit of uprobe code, I assume this is a fixup for when
we're running code that got moved out of line because it got replaced
by a breakpoint. I'm still mystified by why it only seems to apply to
#DE and #UD.
Powered by blists - more mailing lists