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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D957C4332F for ; Mon, 7 Mar 2022 15:57:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231715AbiCGP6C (ORCPT ); Mon, 7 Mar 2022 10:58:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243998AbiCGP6A (ORCPT ); Mon, 7 Mar 2022 10:58:00 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 790267D00F; Mon, 7 Mar 2022 07:57:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=WrCk5Zjz4zeQvJI59w3Y1NYye/gptEQDerS0Psr1TZ4=; b=wW7FyJ7wdAgP5ZxLNFEf3eQpn9 s8zqFBSs7eoLCpygyX9Z4BS+JtlrW3VXFyql7r4copov9R+nc+r3Nnf6PiKouoQ3GnzE/lX4O9lA5 qtqgL9RKeZTtgw8gRuuv/SFUIU5CglX+vJdOpIkh3XPo2fAv6370VZMHInrLYfgtq0VgKP8mbn98U BGM12OyvkgjC+U3Uz3Ql1bFFylM+W9CTN4fhip9qJ9LDDtx5Zwk0+/CZBJZu4TvAonJOfFmJNBQQj fG7eq9hrelFEh0pr9otbFYrrr622HUWFXIFB1E0lSVCG7DB/Ig2g5G/VZ49wcOXg1BS2R65TowNqr LeKXy8DQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRFjB-000kY3-Ou; Mon, 07 Mar 2022 15:56:53 +0000 Date: Mon, 7 Mar 2022 07:56:53 -0800 From: Christoph Hellwig To: Jarkko Sakkinen Cc: Christoph Hellwig , Matthew Wilcox , linux-mm@kvack.org, Dave Hansen , Nathaniel McCallum , Reinette Chatre , Andrew Morton , linux-sgx@vger.kernel.org, linux-kernel@vger.kernel.org, Florian Fainelli , Thomas Bogendoerfer , Matthew Auld , Thomas =?iso-8859-1?Q?Hellstr=F6m?= , Daniel Vetter , Jason Ekstrand , Chris Wilson , G@iki.fi, Maarten Lankhorst , Greg Kroah-Hartman , Tvrtko Ursulin , Vasily Averin , Shakeel Butt , Michal Hocko , zhangyiru , Alexey Gladkov , Alexander Mikhalitsyn , linux-mips@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, codalist@coda.cs.cmu.edu, linux-unionfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH RFC 0/3] MAP_POPULATE for device memory Message-ID: References: <20220306053211.135762-1-jarkko@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-unionfs@vger.kernel.org On Mon, Mar 07, 2022 at 03:29:35PM +0200, Jarkko Sakkinen wrote: > So what would you suggest to sort out the issue? I'm happy to go with > ioctl if nothing else is acceptable. PLenty of drivers treat all mmaps as if MAP_POPULATE was specified, typically by using (io_)remap_pfn_range. If there any reason to only optionally have the pre-fault semantics for sgx? If not this should be really simple. And if we have a real need for it to be optional we'll just need to find a sane way to pass that information to ->mmap. 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 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 53202C433EF for ; Mon, 7 Mar 2022 15:57:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4AEC610E00F; Mon, 7 Mar 2022 15:57:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by gabe.freedesktop.org (Postfix) with ESMTPS id C549D10E00F; Mon, 7 Mar 2022 15:57:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=WrCk5Zjz4zeQvJI59w3Y1NYye/gptEQDerS0Psr1TZ4=; b=wW7FyJ7wdAgP5ZxLNFEf3eQpn9 s8zqFBSs7eoLCpygyX9Z4BS+JtlrW3VXFyql7r4copov9R+nc+r3Nnf6PiKouoQ3GnzE/lX4O9lA5 qtqgL9RKeZTtgw8gRuuv/SFUIU5CglX+vJdOpIkh3XPo2fAv6370VZMHInrLYfgtq0VgKP8mbn98U BGM12OyvkgjC+U3Uz3Ql1bFFylM+W9CTN4fhip9qJ9LDDtx5Zwk0+/CZBJZu4TvAonJOfFmJNBQQj fG7eq9hrelFEh0pr9otbFYrrr622HUWFXIFB1E0lSVCG7DB/Ig2g5G/VZ49wcOXg1BS2R65TowNqr LeKXy8DQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRFjB-000kY3-Ou; Mon, 07 Mar 2022 15:56:53 +0000 Date: Mon, 7 Mar 2022 07:56:53 -0800 From: Christoph Hellwig To: Jarkko Sakkinen Message-ID: References: <20220306053211.135762-1-jarkko@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Subject: Re: [Intel-gfx] [PATCH RFC 0/3] MAP_POPULATE for device memory X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michal Hocko , zhangyiru , Daniel Vetter , Dave Hansen , dri-devel@lists.freedesktop.org, Chris Wilson , linux-mm@kvack.org, Alexander Mikhalitsyn , Florian Fainelli , linux-unionfs@vger.kernel.org, Matthew Wilcox , codalist@coda.cs.cmu.edu, Christoph Hellwig , Matthew Auld , Vasily Averin , Thomas =?iso-8859-1?Q?Hellstr=F6m?= , intel-gfx@lists.freedesktop.org, G@iki.fi, linux-mips@vger.kernel.org, Shakeel Butt , Reinette Chatre , linux-sgx@vger.kernel.org, Thomas Bogendoerfer , Nathaniel McCallum , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Andrew Morton , Alexey Gladkov Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Mon, Mar 07, 2022 at 03:29:35PM +0200, Jarkko Sakkinen wrote: > So what would you suggest to sort out the issue? I'm happy to go with > ioctl if nothing else is acceptable. PLenty of drivers treat all mmaps as if MAP_POPULATE was specified, typically by using (io_)remap_pfn_range. If there any reason to only optionally have the pre-fault semantics for sgx? If not this should be really simple. And if we have a real need for it to be optional we'll just need to find a sane way to pass that information to ->mmap.