Re: [PATCH v2 01/11] s390/uaccess: Add copy_from/to_user_key functions

Heiko Carstens
2022-02-07T19:28:10Z

On Mon, Feb 07, 2022 at 05:59:20PM +0100, Janis Schoetterl-Glausch wrote:
> Add copy_from/to_user_key functions, which perform storage key checking.
> These functions can be used by KVM for emulating instructions that need
> to be key checked.
> These functions differ from their non _key counterparts in
> include/linux/uaccess.h only in the additional key argument and must be
> kept in sync with those.
>
> Since the existing uaccess implementation on s390 makes use of move
> instructions that support having an additional access key supplied,
> we can implement raw_copy_from/to_user_key by enhancing the
> existing implementation.
>
> Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
> ---
> arch/s390/include/asm/uaccess.h | 22 +++++++++
> arch/s390/lib/uaccess.c | 81 +++++++++++++++++++++++++--------
> 2 files changed, 85 insertions(+), 18 deletions(-)

Acked-by: Heiko Carstens <hca@linux.ibm.com>

Christian, Janosch, I think this can go via the kvm tree.