Re: [PATCH] x86/retpoline/entry: Disable the entire SYSCALL64 fast path with retpolines on

From: Andy Lutomirski
Date: Fri Jan 26 2018 - 10:58:03 EST


On Fri, Jan 26, 2018 at 6:24 AM, Alan Cox <alan@xxxxxxxxxxxxxxx> wrote:
>> NetBSD (and the other BSD?) defines a structure for the arguments to
>> each syscall.
>
> Goes back to v7 or so but they put the syscall arguments into the uarea
> so that no pointers were needed (uarea being a per process mapping at a
> fixed address) in order to also reduce pointer dereferencing costs (not
> that those matter much on modern processors)
>

I gave the rearrangement like this a try yesterday and it's a bit of a
mess. Part of the problem is that there are a bunch of pieces of code
that expect sys_xyz() to be actual callable functions. The best way
to deal with that is probably to switch to calling normal functions.