Christoph Hellwig 37c54f9bd4 kernel: set USER_DS in kthread_use_mm
Some architectures like arm64 and s390 require USER_DS to be set for
kernel threads to access user address space, which is the whole purpose of
kthread_use_mm, but other like x86 don't.  That has lead to a huge mess
where some callers are fixed up once they are tested on said
architectures, while others linger around and yet other like io_uring try
to do "clever" optimizations for what usually is just a trivial asignment
to a member in the thread_struct for most architectures.

Make kthread_use_mm set USER_DS, and kthread_unuse_mm restore to the
previous value instead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Tested-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Felipe Balbi <balbi@kernel.org>
Cc: Felix Kuehling <Felix.Kuehling@amd.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Cc: Zhi Wang <zhi.a.wang@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: http://lkml.kernel.org/r/20200404094101.672954-7-hch@lst.de
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-06-10 19:14:18 -07:00
..
2020-03-27 09:29:56 +00:00
2020-06-09 18:17:14 +01:00
2020-06-01 12:10:17 -07:00
2020-06-05 16:43:16 -07:00
2020-06-02 20:16:55 -07:00
2020-06-09 11:24:59 -07:00
2019-11-11 09:21:59 -05:00
2020-06-09 10:04:47 -07:00
2020-06-09 11:28:59 -07:00
2020-06-09 15:48:24 -07:00
2020-06-08 12:47:09 -07:00
2020-06-02 15:29:19 -07:00
2020-06-02 15:29:19 -07:00
2020-06-02 20:11:35 -07:00
\n
2020-06-04 13:51:54 -07:00
2020-06-09 15:40:50 -07:00
\n
2020-06-04 13:53:10 -07:00
2020-06-05 14:05:57 -07:00
2020-06-02 15:29:19 -07:00
2019-09-19 09:42:37 -07:00
2020-06-04 13:50:13 -07:00
2020-06-02 15:37:03 -07:00
2020-06-02 19:59:25 -07:00
2020-05-14 16:44:25 +02:00
2020-02-07 14:48:35 -05:00
2020-06-05 16:26:36 -07:00
2020-06-10 19:14:18 -07:00
2020-03-05 21:00:40 -05:00
2020-05-14 16:44:24 +02:00
2020-06-09 15:40:50 -07:00
2019-12-08 14:37:36 +01:00
2020-06-02 19:45:12 -07:00
2020-06-02 15:29:19 -07:00
2020-06-09 15:40:50 -07:00
2020-05-14 16:44:24 +02:00
2020-04-09 15:33:09 -04:00