s390/zcrypt: remove set_fs() invocation in zcrypt device driver
authorHarald Freudenberger <freude@linux.ibm.com>
Tue, 15 Sep 2020 15:01:58 +0000 (17:01 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Thu, 17 Sep 2020 12:11:03 +0000 (14:11 +0200)
commit52f72feba9dbe4fac848ae0d90bc0b85b17f91bc
treecd865598198e7b09a7ed99196062689700f43d60
parentc360c9a238d1754b1ee8f1c3368ef36794e1daab
s390/zcrypt: remove set_fs() invocation in zcrypt device driver

This patch reworks the zcrypt device driver so that the set_fs()
invocation is not needed any more. Instead there is a new flag bool
userspace passed through all the functions which tells if the pointer
arguments are userspace or kernelspace. Together with the two new
inline functions z_copy_from_user() and z_copy_to_user() which either
invoke copy_from_user (userspace is true) or memcpy (userspace is
false) the zcrypt dd and the AP bus now has no requirement for
the set_fs() functionality any more.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Ingo Franzki <ifranzki@linux.ibm.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
drivers/s390/crypto/zcrypt_api.c
drivers/s390/crypto/zcrypt_api.h
drivers/s390/crypto/zcrypt_ccamisc.c
drivers/s390/crypto/zcrypt_ep11misc.c
drivers/s390/crypto/zcrypt_msgtype6.c
drivers/s390/crypto/zcrypt_msgtype6.h