From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Subject: Re: [PATCH 3/3] kernel: set USER_DS in kthread_use_mm Date: Thu, 16 Apr 2020 08:43:11 +0200 Message-ID: <20200416064311.GA300290@kroah.com> References: <20200416053158.586887-1-hch@lst.de> <20200416053158.586887-4-hch@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20200416053158.586887-4-hch@lst.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Christoph Hellwig Cc: Jens Axboe , Felipe Balbi , amd-gfx@lists.freedesktop.org, "Michael S. Tsirkin" , intel-gvt-dev@lists.freedesktop.org, Felix Kuehling , linux-usb@vger.kernel.org, io-uring@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Al Viro , intel-gfx@lists.freedesktop.org, Alex Deucher , Andrew Morton , Linus Torvalds , Jason Wang List-Id: virtualization@lists.linuxfoundation.org On Thu, Apr 16, 2020 at 07:31:58AM +0200, Christoph Hellwig wrote: > 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 > Acked-by: Michael S. Tsirkin [vhost] > --- Acked-by: Greg Kroah-Hartman [usb]