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.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 2D221C388F9 for ; Wed, 4 Nov 2020 18:17:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 65D502083B for ; Wed, 4 Nov 2020 18:17:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="nBv9S+jw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 65D502083B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 83D946B0071; Wed, 4 Nov 2020 13:17:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7F06B6B0072; Wed, 4 Nov 2020 13:17:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6B6836B0073; Wed, 4 Nov 2020 13:17:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0236.hostedemail.com [216.40.44.236]) by kanga.kvack.org (Postfix) with ESMTP id 3F18B6B0071 for ; Wed, 4 Nov 2020 13:17:11 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id C0B1E1EE6 for ; Wed, 4 Nov 2020 18:17:10 +0000 (UTC) X-FDA: 77447542620.12.space23_370a675272c3 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id 98797180555D0 for ; Wed, 4 Nov 2020 18:17:10 +0000 (UTC) X-HE-Tag: space23_370a675272c3 X-Filterd-Recvd-Size: 5681 Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Wed, 4 Nov 2020 18:17:10 +0000 (UTC) Received: by mail-qt1-f195.google.com with SMTP id m65so12821001qte.11 for ; Wed, 04 Nov 2020 10:17:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=0IlAXzxWFTQTUuhmHtEVnKs2xhR6KwI7WPZxiLpUe5M=; b=nBv9S+jwc5JdfLlq4RL/YRGMRQsYfNmjawGrU9GxIfERfAzcpQgZP7hrv69Mesc6M+ quTXVEbUxyGRkpm9rbsP8azSm9DhVnbhxJgRfZltG0yrlTEb9tUc276PX/VzeI4+sRFb 4r/IU25uiRBU2ueg3BK2D1b5dzTlQrhsuR29PTFyGpgIBwSarkIUR8LSQBS70hi2P/nX 3m9r9pQVhoUF1DKe/otBAG1Rv7Kcrglv3VfUI2ehd7bNrMEt5ljYuJ0XfoYPWDc7w4EG xr2aRwLmdjA9s+hlno1U0yOoQqyB/mpuAfQuUyKvK6M+DNWEL6fkUm6gwdGKM5MFyxPD 3ciQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=0IlAXzxWFTQTUuhmHtEVnKs2xhR6KwI7WPZxiLpUe5M=; b=q9CdDlEa5Q0gsZ4wN8S1m+irhXpepfKT1ni8XBFKfDfgjv5OEnBGI0+C6066EaSVpp zljv2DIEgoHuQhZ1D3lHp15IK5mDmLIyKgjUrcjTLZC+ER7Mg6fqN7AazjFw/AXDj/wM 2qaKs6H91zFzHIrkHLb2z490ltX4N5l7AsjCNTd5J7ifCcD2fcwR7FlLcqaP5AajGlir IdimHrZAVJuXeLF/Uo9kCh9h1zctr8Xo/ozjDrgGaP+MB2RnSTL5a9xsroPJyzlwoopV hZj0vbbPHyUa6dSnfXN2W8aBLZ8n3I/+aHbbNE1+SvHQLUQGHuHMsWo3TbjvZHriDgZT t48A== X-Gm-Message-State: AOAM533al/r3onGmCCRju+B+LSEzJtga2jJfGTaVbtOHoNZf+FKxnHlO F9Jx2+jWIk9d2z3roVb4QXJETA== X-Google-Smtp-Source: ABdhPJzbeLbokY3xWw1ad4Wlq96Bw2Ur+AXtnppBcNVDAcKLM++yGsaQXPWFUe04HeoITS7ilZQ2EA== X-Received: by 2002:ac8:590c:: with SMTP id 12mr12840139qty.28.1604513829572; Wed, 04 Nov 2020 10:17:09 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id a30sm701698qtn.55.2020.11.04.10.17.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Nov 2020 10:17:08 -0800 (PST) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kaNLI-00GaUi-BN; Wed, 04 Nov 2020 14:17:08 -0400 Date: Wed, 4 Nov 2020 14:17:08 -0400 From: Jason Gunthorpe To: Christoph Hellwig Cc: Daniel Vetter , 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: <20201104181708.GU36674@ziepe.ca> 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> <20201104164119.GA18218@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201104164119.GA18218@infradead.org> 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:41:19PM +0000, Christoph Hellwig wrote: > 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. Mm, I thought it was probably the special flag.. Knowing that CONFIG_HAVE_FAST_GUP can't be set without CONFIG_ARCH_HAS_PTE_SPECIAL is pretty insightful, can we put that in the Kconfig? config HAVE_FAST_GUP depends on MMU depends on ARCH_HAS_PTE_SPECIAL bool ? Jason