RE: [RFC][PATCH 01/22] x86 user stack frame reads: switch to explicit __get_user()
From: David Laight
Date: Sun Mar 29 2020 - 14:03:56 EST
From: Linus Torvalds
> Sent: 29 March 2020 18:57
> On Sun, Mar 29, 2020 at 10:41 AM David Laight <David.Laight@xxxxxxxxxx> wrote:
> >
> > It may be worth implementing get_user() as an inline
> > function that writes the result of access_ok() to a
> > 'by reference' parameter and then returns the value
> > from an 'real' __get_user() function.
>
> That's how get_user() already works.
>
> It is a polymorphic function (done using macros, sizeof() and ugly
> compiler tricks) that generates a call, yes. But it's not a normal C
> call. On x86-64, it returns the error code in %rax, and the value in
> %rdx
I must be mis-remembering the object code from last time
I looked at it.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)