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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A5B5C433EF for ; Wed, 20 Oct 2021 19:38:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 047EB61354 for ; Wed, 20 Oct 2021 19:38:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 047EB61354 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 7E9BA940007; Wed, 20 Oct 2021 15:38:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 799376B0082; Wed, 20 Oct 2021 15:38:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6605A940007; Wed, 20 Oct 2021 15:38:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0033.hostedemail.com [216.40.44.33]) by kanga.kvack.org (Postfix) with ESMTP id 533C36B0081 for ; Wed, 20 Oct 2021 15:38:04 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 110548249980 for ; Wed, 20 Oct 2021 19:38:04 +0000 (UTC) X-FDA: 78717826488.08.E7C65AA Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) by imf16.hostedemail.com (Postfix) with ESMTP id A0864F000090 for ; Wed, 20 Oct 2021 19:38:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=25uxvcU8Q6SEEyqa5u7IFHx2RyyudtDeLjhkROKSTUk=; b=h/oQA+oze8XD4yl/NvHbXK8Yd6 jleU0NVVf9yFgu0+diJb00fWwZ6ggm3XO5xaRJK3EIYJrafTX9uvgSwRPGAXbbsn+j6xErrcU7Grw GCMgyBcIFMYxiXACw2uCW1ZWYNUTbtf+4VzM0RE9UbXFb2Mj2yNa6iAcjJ7IHn9WvNt+TN+RU3d0+ Dg5FaZu3cm89n9GsUgsdDBQ3S1X0hhv/1QC6+tCDvIkFXRtP6+gOtHmMFQGyz22GEmgVziLI70eKJ g4cJ/k8aXUj0kGaUMMeXXbB0gWWbhSaiXOW5WOln24rM8nlbNRe5XJX5Pe2e395ee3UElWDAda/B0 LPCKXCsg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdHPL-00B0wV-BZ; Wed, 20 Oct 2021 19:37:51 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 6B710986DD9; Wed, 20 Oct 2021 21:37:51 +0200 (CEST) Date: Wed, 20 Oct 2021 21:37:51 +0200 From: Peter Zijlstra To: Lucas De Marchi Cc: Christoph Hellwig , Andrew Morton , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Daniel Vetter , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Chris Wilson , linux-mm@kvack.org, matthew.auld@intel.com Subject: Re: [Intel-gfx] [PATCH 2/4] mm: add a io_mapping_map_user helper Message-ID: <20211020193751.GS174703@worktop.programming.kicks-ass.net> References: <20210326055505.1424432-1-hch@lst.de> <20210326055505.1424432-3-hch@lst.de> <20211020154005.uk6u4ovcmlhpyubk@ldmartin-desk2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211020154005.uk6u4ovcmlhpyubk@ldmartin-desk2> X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: A0864F000090 X-Stat-Signature: szypswrrjsrjafxxjnzyd1pq4u6fp7tb Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b="h/oQA+oz"; dmarc=none; spf=none (imf16.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org X-HE-Tag: 1634758680-313930 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 Wed, Oct 20, 2021 at 08:40:05AM -0700, Lucas De Marchi wrote: > On Fri, Mar 26, 2021 at 06:55:03AM +0100, Christoph Hellwig wrote: > > Add a helper that calls remap_pfn_range for an struct io_mapping, relying > > on the pgprot pre-validation done when creating the mapping instead of > > doing it at runtime. > > > > Signed-off-by: Christoph Hellwig > > --- > > include/linux/io-mapping.h | 3 +++ > > mm/Kconfig | 3 +++ > > mm/Makefile | 1 + > > mm/io-mapping.c | 29 +++++++++++++++++++++++++++++ > > 4 files changed, 36 insertions(+) > > create mode 100644 mm/io-mapping.c > > > > diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h > > index c093e81310a9b3..e9743cfd858527 100644 > > --- a/include/linux/io-mapping.h > > +++ b/include/linux/io-mapping.h > > @@ -220,3 +220,6 @@ io_mapping_free(struct io_mapping *iomap) > > } > > > > #endif /* _LINUX_IO_MAPPING_H */ > > + > > +int io_mapping_map_user(struct io_mapping *iomap, struct vm_area_struct *vma, > > + unsigned long addr, unsigned long pfn, unsigned long size); > > I'm not sure what exactly brought me to check this, but while debugging > I noticed this outside the header guard. But then after some more checks I > saw nothing actually selects CONFIG_IO_MAPPING because commit using > it was reverted in commit 0e4fe0c9f2f9 ("Revert "i915: use io_mapping_map_user"") > > Is this something we want to re-attempt moving to mm/ ? Yes, it would be very good to unexport apply_to_page_range(), it's a terrible interface to expose.