Re: [RFC PATCH v1 01/10] s390/uaccess: Add storage key checked access to user memory

From: Heiko Carstens
Date: Thu Jan 20 2022 - 13:19:31 EST


On Thu, Jan 20, 2022 at 01:56:40PM +0100, Heiko Carstens wrote:
> > 2. Implementation changes
> > 2.1 Modify common code
>
> In general such changes are done in way that common code is or _may_ be
> modified to fulfill our needs. Common code header file explicitely states
> that architectures should get rid of private instances of
> copy_{to,from}_user() and __copy_{to,from}_user{,_inatomic}().
>
> So we should not add anything like that to arch code again, since nobody
> would expect that.

Or to be more specific: I think the most simple solution would be to
try to get the new *key variants into include/linux/uaccess.h, and add
the raw variants in architecture code, similar to the rest of the
uaccess functions.
There is some (sort of) prior art with copy_mc_to_kernel() even,
though that can only partially be compared.