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.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 6E6CDC2D0A3 for ; Wed, 4 Nov 2020 16:41:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D4D74206CA for ; Wed, 4 Nov 2020 16:41:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Y1htN0aB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D4D74206CA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4AA566B005D; Wed, 4 Nov 2020 11:41:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4326E6B0068; Wed, 4 Nov 2020 11:41:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2FB1D6B006C; Wed, 4 Nov 2020 11:41:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0138.hostedemail.com [216.40.44.138]) by kanga.kvack.org (Postfix) with ESMTP id F335E6B005D for ; Wed, 4 Nov 2020 11:41:31 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 8FD45362C for ; Wed, 4 Nov 2020 16:41:31 +0000 (UTC) X-FDA: 77447301582.13.pipe41_6109119272c2 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 6AB6018140B67 for ; Wed, 4 Nov 2020 16:41:31 +0000 (UTC) X-HE-Tag: pipe41_6109119272c2 X-Filterd-Recvd-Size: 3966 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Wed, 4 Nov 2020 16:41:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=N+PdC8aIRIGAg2FR28I1P/4kBIo6jnmN4QhPRmCU08A=; b=Y1htN0aBJKelZ9PF10bOpkfzNm AbdmBX7uwg/dy8j86ohk0c2kPpXPZzG0w5faSlS/dCeaixKVHRJuLcLLQ7dQcHXbInbLBAAwWbgY2 0+jbViIJWH+PzBiBQWi2s9Jrmk/I8R62cvYgsYWRhrqxOhT5cze01WusTw+gBleoPF6GUkV4wguSf GN2jz0PJcmRTFJ9I/UNw0GwSXF3aEF7PE7twMLwlKVN5jr+K8DmA/zIiIGLLHLjPRHUvfri1ifWkQ lhzs6zF6PkoS5rz5oqYfTnpenyuB+ufAq0MXJl0XWojaqOVac3o65QNUxwOqel58DO/Tkmn/n4Rzl T1oYFK8w==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaLqZ-0004uc-8m; Wed, 04 Nov 2020 16:41:19 +0000 Date: Wed, 4 Nov 2020 16:41:19 +0000 From: Christoph Hellwig To: Daniel Vetter Cc: Christoph Hellwig , Jason Gunthorpe , J??r??me Glisse , linux-samsung-soc , Jan Kara , Pawel Osciak , KVM list , John Hubbard , Mauro Carvalho Chehab , LKML , DRI Development , Tomasz Figa , Linux MM , Kyungmin Park , Daniel Vetter , Andrew Morton , Marek Szyprowski , Dan Williams , Linux ARM , "open list:DMA BUFFER SHARING FRAMEWORK" Subject: Re: [PATCH v5 05/15] mm/frame-vector: Use FOLL_LONGTERM Message-ID: <20201104164119.GA18218@infradead.org> References: <1f7cf690-35e2-c56f-6d3f-94400633edd2@nvidia.com> <7f29a42a-c408-525d-90b7-ef3c12b5826c@nvidia.com> <20201104140023.GQ36674@ziepe.ca> <20201104162125.GA13007@infradead.org> <20201104163758.GA17425@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201104163758.GA17425@infradead.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html 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, Nov 04, 2020 at 04:37:58PM +0000, Christoph Hellwig wrote: > On Wed, Nov 04, 2020 at 05:26:58PM +0100, Daniel Vetter wrote: > > What we're discussing is whether gup_fast and pup_fast also obey this, > > or fall over and can give you the struct page that's backing the > > dma_mmap_* memory. Since the _fast variant doesn't check for > > vma->vm_flags, and afaict that's the only thing which closes this gap. > > And like you restate, that would be a bit a problem. So where's that > > check which Jason&me aren't spotting? > > remap_pte_range uses pte_mkspecial to set up the PTEs, and gup_pte_range > errors out on pte_special. Of course this only works for the > CONFIG_ARCH_HAS_PTE_SPECIAL case, for other architectures we do have > a real problem. Except that we don't really support pte-level gup-fast without CONFIG_ARCH_HAS_PTE_SPECIAL, and in fact all architectures selecting HAVE_FAST_GUP also select ARCH_HAS_PTE_SPECIAL, so we should be fine.