[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFzM8ynf4m-X6EPS10gxNqsKPN_8mGucGHvBp8H+OkgW3g@mail.gmail.com>
Date: Wed, 7 Feb 2018 09:05:03 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Andi Kleen <ak@...ux.intel.com>
Cc: Dominik Brodowski <linux@...inikbrodowski.net>,
Ingo Molnar <mingo@...nel.org>,
Dan Williams <dan.j.williams@...el.com>,
Thomas Gleixner <tglx@...utronix.de>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Andrew Lutomirski <luto@...nel.org>,
"the arch/x86 maintainers" <x86@...nel.org>
Subject: Re: [PATCH tip-pti 2/2] x86/entry: interleave XOR register clearing
with PUSH/MOV instructions
On Wed, Feb 7, 2018 at 7:18 AM, Andi Kleen <ak@...ux.intel.com> wrote:
>
> Fast path saves more than just register saving. I changed the fast path
> to save all registers in my earlier clearregs branches
I know. I saw your patches. And I went "Eww".
> It is still quite a bit faster than all the slow stuff the C do_syscall
> code does (e.g. reloading all the arguments, setting up unnecessary
> frame pointers etc.).
>
> Just take a look at the disassembly of that function. It's really
> not very optimized.
Actually, only the argument reloading _really_ annoys me in do_syscall().
And I do think we should be able to fix that fairly easily by moving
it into the SYSCALLx() macros - at least for 64-bit (32-bit has nasty
issues with 64-bit arguments).
The other thing we need to do is to just pass down the system call
number as an argument instead of reloading it.
Linus
Powered by blists - more mailing lists