linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Andy Lutomirski <luto@amacapital.net>,
	Linux List Kernel Mailing <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Andy Lutomirski <luto@kernel.org>,
	Nicolai Stange <nstange@suse.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"the arch/x86 maintainers" <x86@kernel.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Jiri Kosina <jikos@kernel.org>, Miroslav Benes <mbenes@suse.cz>,
	Petr Mladek <pmladek@suse.com>,
	Joe Lawrence <joe.lawrence@redhat.com>,
	Shuah Khan <shuah@kernel.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Tim Chen <tim.c.chen@linux.intel.com>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Mimi Zohar <zohar@linux.ibm.com>, Juergen Gross <jgross@suse.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Nayna Jain <nayna@linux.ibm.com>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Joerg Roedel <jroedel@suse.de>,
	"open list:KERNEL SELFTEST FRAMEWORK" 
	<linux-kselftest@vger.kernel.org>,
	stable <stable@vger.kernel.org>,
	Masami Hiramatsu <mhiramat@kernel.org>
Subject: Re: [RFC][PATCH 1/2] x86: Allow breakpoints to emulate call functions
Date: Tue, 7 May 2019 10:08:50 -0700	[thread overview]
Message-ID: <CAHk-=wiuue37opWK5QaQ9f6twqDZuSratdP-1bK6kD9-Az5WnA@mail.gmail.com> (raw)
In-Reply-To: <20190507163440.GV2606@hirez.programming.kicks-ass.net>

On Tue, May 7, 2019 at 9:34 AM Peter Zijlstra <peterz@infradead.org> wrote:
>
> Would you consider my approach later on, under the guise of unification?

WHY?

The *only* advantage of your patch is that trivial "look up kernel stack" macro.

Seriously. There's absolutely nothing else.

Is that macro ugly? Yes. But it's directly explainable by just
pointing to the architecture documentation.

It's a one-liner hack.

And for that, you want to complicate the x86-32 entry and exit code?

Do we have different emulation for "push" on 32-bit and 64-bit? Yes.
But again, that's just how the hardware works. This is not some
"generic hw-independent code". This is literally emulating
instructions that care about instruction encoding and bit size
details, where there are certainly _similarities_ (and in the case of
'call', they look bit-identical), but it's also not like "same code"
is a big argument. That's why we have a helper function, to hide the
details.

I point to my diffstat once again. It's smaller, and I argue that it
is actually conceptually *simpler* to simply say "this is how the
architecture works".

And yes, I realize that I may be biased by the fact that I simply know
i386 so well, so to me it simply makes more sense to just work with
what the hardware gives us. The i386 exception model with the kernel
stack nesting is a *hell* of a lot simpler than the x86-64 one. The
fact is, x86-64 messed things up, and swapgs and friends are an
abomination against God.

So the whole "let's clean up x86-32 to look like x86-64, which got
things right" is to me a completely bogus argument. x86-64 got the
"yes, push ss/sp unconditionally" part right, but got a lot of other
things horribly wrong. So this is all just one small detail that
differs, across two architectures that are similar but have very
different warts.

But that diffstat is still hard, cold, unbiased data.

                    Linus

  reply	other threads:[~2019-05-07 17:16 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-01 20:28 [RFC][PATCH 0/2] ftrace/x86: Allow for breakpoint handlers to emulate call functions Steven Rostedt
2019-05-01 20:28 ` [RFC][PATCH 1/2] x86: Allow breakpoints " Steven Rostedt
2019-05-02  3:24   ` Steven Rostedt
2019-05-02 16:21     ` Peter Zijlstra
2019-05-02 16:29       ` Peter Zijlstra
2019-05-02 18:02       ` Linus Torvalds
2019-05-02 18:18         ` Peter Zijlstra
2019-05-02 18:30           ` Peter Zijlstra
2019-05-02 18:43           ` Linus Torvalds
2019-05-02 19:28             ` Jiri Kosina
2019-05-02 20:25               ` Andy Lutomirski
2019-05-02 20:21             ` Peter Zijlstra
2019-05-02 20:49               ` Linus Torvalds
2019-05-02 21:32                 ` Peter Zijlstra
2019-05-03 19:24                 ` Steven Rostedt
2019-05-03 21:46                   ` Linus Torvalds
2019-05-03 22:49                     ` Steven Rostedt
2019-05-03 23:07                       ` Linus Torvalds
2019-05-04  4:17                         ` Steven Rostedt
     [not found]                           ` <CAHk-=wiuSFbv_rELND-BLWcP0GSZ0yF=xOAEcf61GE3bU9d=yg@mail.gmail.com>
2019-05-04 18:59                             ` Linus Torvalds
2019-05-04 20:12                               ` Andy Lutomirski
2019-05-04 20:28                                 ` Linus Torvalds
2019-05-04 20:36                                 ` Linus Torvalds
2019-05-03 22:55                     ` Andy Lutomirski
2019-05-03 23:16                       ` Linus Torvalds
2019-05-03 23:32                         ` Andy Lutomirski
2019-05-02 22:52               ` Steven Rostedt
2019-05-02 23:31                 ` Steven Rostedt
2019-05-02 23:50                   ` Steven Rostedt
2019-05-03  1:51                     ` [RFC][PATCH 1/2 v2] " Steven Rostedt
2019-05-03  9:29                     ` [RFC][PATCH 1/2] " Peter Zijlstra
2019-05-03 13:22                       ` Steven Rostedt
2019-05-03 16:20                         ` Andy Lutomirski
2019-05-03 16:31                           ` Steven Rostedt
2019-05-03 16:35                             ` Peter Zijlstra
2019-05-03 16:44                               ` Andy Lutomirski
2019-05-03 16:49                                 ` Steven Rostedt
2019-05-03 16:32                           ` Peter Zijlstra
2019-05-03 18:57                           ` Linus Torvalds
2019-05-06  8:19                             ` Peter Zijlstra
2019-05-06 13:56                               ` Steven Rostedt
2019-05-06 16:17                                 ` Linus Torvalds
2019-05-06 16:19                                   ` Linus Torvalds
2019-05-06 17:06                                   ` Steven Rostedt
2019-05-06 18:06                                     ` Linus Torvalds
2019-05-06 18:57                                       ` Steven Rostedt
2019-05-06 19:46                                         ` Linus Torvalds
2019-05-06 20:29                                           ` Steven Rostedt
2019-05-06 20:42                                             ` Linus Torvalds
2019-05-06 20:44                                               ` Linus Torvalds
2019-05-06 21:45                                               ` Steven Rostedt
2019-05-06 22:06                                                 ` Linus Torvalds
2019-05-06 22:31                                                   ` Linus Torvalds
2019-05-07  0:10                                                     ` Steven Rostedt
2019-05-07  1:06                                                       ` Linus Torvalds
2019-05-07  1:04                                                   ` Steven Rostedt
2019-05-07  1:34                                                     ` Steven Rostedt
2019-05-07  1:34                                                     ` Linus Torvalds
2019-05-07  1:53                                                       ` Steven Rostedt
2019-05-07  2:22                                                         ` Linus Torvalds
2019-05-07  2:58                                                           ` Steven Rostedt
2019-05-07  3:05                                                             ` Linus Torvalds
2019-05-07  3:21                                                               ` Steven Rostedt
2019-05-07  3:28                                                                 ` Linus Torvalds
2019-05-07 14:54                                                                   ` Linus Torvalds
2019-05-07 15:12                                                                     ` Steven Rostedt
2019-05-07 15:25                                                                       ` Steven Rostedt
2019-05-07 16:25                                                                         ` Steven Rostedt
2019-05-07 15:31                                                                       ` Linus Torvalds
2019-05-07 15:45                                                                         ` Steven Rostedt
2019-05-07 16:34                                                                         ` Peter Zijlstra
2019-05-07 17:08                                                                           ` Linus Torvalds [this message]
2019-05-07 17:21                                                                             ` Josh Poimboeuf
2019-05-07 21:24                                                                               ` Steven Rostedt
2019-05-08  4:50                                                                                 ` Linus Torvalds
2019-05-08 16:37                                                                                   ` Steven Rostedt
2019-05-07 17:38                                                                             ` Peter Zijlstra
2019-05-07  9:51                                                           ` Peter Zijlstra
2019-05-07 14:48                                                           ` Andy Lutomirski
2019-05-07 14:57                                                             ` Linus Torvalds
2019-05-07 14:13                                                 ` Masami Hiramatsu
2019-05-07 17:15                                                   ` Masami Hiramatsu
2019-05-06 14:22                               ` Peter Zijlstra
2019-05-07  8:57                               ` Peter Zijlstra
2019-05-07  9:18                                 ` David Laight
2019-05-07 11:30                                   ` Peter Zijlstra
2019-05-07 12:57                                     ` David Laight
2019-05-07 13:14                                       ` Steven Rostedt
2019-05-07 14:50                                         ` David Laight
2019-05-07 14:57                                           ` Steven Rostedt
2019-05-07 15:46                                             ` David Laight
2019-05-07 13:32                                       ` Peter Zijlstra
2019-05-07  9:27                                 ` Peter Zijlstra
2019-05-07 12:27                                   ` Steven Rostedt
2019-05-07 12:41                                     ` Peter Zijlstra
2019-05-07 12:54                                       ` Steven Rostedt
2019-05-07 17:22                                         ` Masami Hiramatsu
2019-05-07 14:28                                 ` Peter Zijlstra
2019-05-02 20:48         ` Steven Rostedt
2019-05-06 15:14         ` Josh Poimboeuf
2019-05-01 20:28 ` [RFC][PATCH 2/2] ftrace/x86: Emulate call function while updating in breakpoint handler Steven Rostedt
2019-05-03 10:22 ` [RFC][PATCH 1.5/2] x86: Add int3_emulate_call() selftest Peter Zijlstra
2019-05-03 18:46   ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHk-=wiuue37opWK5QaQ9f6twqDZuSratdP-1bK6kD9-Az5WnA@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=bigeasy@linutronix.de \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=jikos@kernel.org \
    --cc=joe.lawrence@redhat.com \
    --cc=jpoimboe@redhat.com \
    --cc=jroedel@suse.de \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=luto@kernel.org \
    --cc=mbenes@suse.cz \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=nayna@linux.ibm.com \
    --cc=ndesaulniers@google.com \
    --cc=nstange@suse.de \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=shuah@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tim.c.chen@linux.intel.com \
    --cc=x86@kernel.org \
    --cc=yamada.masahiro@socionext.com \
    --cc=zohar@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).