lkml.org 
[lkml]   [2019]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 4/4] x86_32: Provide consistent pt_regs

* Josh Poimboeuf <jpoimboe@redhat.com> wrote:

> On Wed, May 08, 2019 at 09:49:05AM +0200, Peter Zijlstra wrote:
> > Currently pt_regs on x86_32 has an oddity in that kernel regs
> > (!user_mode(regs)) are short two entries (esp/ss). This means that any
> > code trying to use them (typically: regs->sp) needs to jump through
> > some unfortunate hoops.
> >
> > Change the entry code to fix this up and create a full pt_regs frame.
> >
> > This then simplifies:
> >
> > - ftrace
> > - kprobes
> > - stack unwinder
> > - ptrace
> > - kdump
> > - kgdb
> >
> > Hated-by: Linus Torvalds <torvalds@linux-foundation.org>
> > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > ---
> > arch/x86/entry/entry_32.S | 105 ++++++++++++++++++++++++++++++++++----
> > arch/x86/include/asm/kexec.h | 17 ------
> > arch/x86/include/asm/ptrace.h | 17 ------
> > arch/x86/include/asm/stacktrace.h | 2
> > arch/x86/kernel/crash.c | 8 --
> > arch/x86/kernel/ftrace_32.S | 81 ++++++++++++++++-------------
> > arch/x86/kernel/kgdb.c | 8 --
> > arch/x86/kernel/kprobes/common.h | 4 -
> > arch/x86/kernel/kprobes/core.c | 29 ++++------
> > arch/x86/kernel/kprobes/opt.c | 20 ++++---
> > arch/x86/kernel/process_32.c | 16 +----
> > arch/x86/kernel/ptrace.c | 29 ----------
> > arch/x86/kernel/time.c | 3 -
> > arch/x86/kernel/unwind_frame.c | 32 +----------
> > arch/x86/kernel/unwind_orc.c | 2
> > 15 files changed, 181 insertions(+), 192 deletions(-)
>
> Very nice diffstat. This moves all the pain to the 32-bit entry code
> where it belongs.

Yes, that's very convincing and looks like a nice simplification of
32-bit x86 entry concepts overall.

Assuming it's correct, the question is whether Linus still hates it? :-)

Thanks,

Ingo

\
 
 \ /
  Last update: 2019-05-08 14:47    [W:0.085 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site