From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48637C2D0EF for ; Thu, 16 Apr 2020 06:43:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1519A21734 for ; Thu, 16 Apr 2020 06:43:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1519A21734 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kroah.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9BB008E0092; Thu, 16 Apr 2020 02:43:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9440E8E0001; Thu, 16 Apr 2020 02:43:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 80B388E0092; Thu, 16 Apr 2020 02:43:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0249.hostedemail.com [216.40.44.249]) by kanga.kvack.org (Postfix) with ESMTP id 650518E0001 for ; Thu, 16 Apr 2020 02:43:15 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 1DE9D5DE0 for ; Thu, 16 Apr 2020 06:43:15 +0000 (UTC) X-FDA: 76712776350.26.paste19_397351786404e X-HE-Tag: paste19_397351786404e X-Filterd-Recvd-Size: 2509 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Thu, 16 Apr 2020 06:43:14 +0000 (UTC) Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8AA5720787; Thu, 16 Apr 2020 06:43:13 +0000 (UTC) Date: Thu, 16 Apr 2020 08:43:11 +0200 From: Greg KH To: Christoph Hellwig Cc: Linus Torvalds , Andrew Morton , Al Viro , Felix Kuehling , Alex Deucher , Zhenyu Wang , Zhi Wang , Felipe Balbi , "Michael S. Tsirkin" , Jason Wang , Jens Axboe , linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-usb@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 3/3] kernel: set USER_DS in kthread_use_mm 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-Disposition: inline In-Reply-To: <20200416053158.586887-4-hch@lst.de> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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]