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=-5.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 5032DC2D0A3 for ; Wed, 4 Nov 2020 18:48:10 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B9F4620782 for ; Wed, 4 Nov 2020 18:48:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Vybo3+ev"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="LevZOWfS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B9F4620782 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Dqi9f2j+I0+TshiRGkVSPg3eWygA/NPTk/IG32p4Qls=; b=Vybo3+evJFc5PEkSN5IVrPbTA /YS8VNNioQwxRBUPX+WQaI9Hcplmz8uhy6sPvNYicEjfM3d+4onBfNZink2P1lOnGO+rRwuMk+qII XiTPCnbw+tzhHyGUsFFUyLGiBufTaY9OG+qAFiNsA0xs1odxZLaiS3hEtL1JL3CeIvFMZYBMD9n9+ n0vTpmaP+KaZ0q3wJPjVszvw2weRDN9vMTspR9IXiNFWGyN9EfDCKBMrepJJ3Iyd0CHTus/goAGZ3 Ng2ScjJnaeqoWpVPG4A6Ja/I1+7g7BGuagYYq6IXsov46aaODkjQWFWgabkkUvq0/7iPVZoB44aVC eHY907W8A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaNn5-0006ue-Si; Wed, 04 Nov 2020 18:45:52 +0000 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaNmP-0006WR-Kd for linux-arm-kernel@lists.infradead.org; Wed, 04 Nov 2020 18:45:30 +0000 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Wed, 04 Nov 2020 10:45:03 -0800 Received: from [10.2.49.167] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 4 Nov 2020 18:44:57 +0000 Subject: Re: [PATCH v5 05/15] mm/frame-vector: Use FOLL_LONGTERM To: Jason Gunthorpe , Christoph Hellwig 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> <20201104181708.GU36674@ziepe.ca> From: John Hubbard Message-ID: Date: Wed, 4 Nov 2020 10:44:56 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20201104181708.GU36674@ziepe.ca> Content-Language: en-US X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1604515503; bh=8Ugq3MVZhAulHFLpXWMZRWPLhPny25VZOQYdcq4TO0Y=; h=Subject:To:CC:References:From:Message-ID:Date:User-Agent: MIME-Version:In-Reply-To:Content-Type:Content-Language: Content-Transfer-Encoding:X-Originating-IP:X-ClientProxiedBy; b=LevZOWfSVNFRWN4kR3miaQt5LJlNcyeB9Ghugs0ySBdOh/MQLGl5DRy1UnBuawKGN MsfMPuReQvwD80mrwk72YzJgprfaPEzy1iWCw2bcBIdepgHc2yIb1Z3tSbNtmEzOtU 74pXxKH+MYaO7mcOVRHUIJlaJ+S6YdrrRiDmU5IgDOTF2gsFbVWNUGDqZmjLUVrBs+ KGS2R/Zsa7bMMbNrwo9WMhxZao/dnX05W1Igj+s1NtoEdpZL8MR5Y+v8eG6ulR90ea VKoKDEiFK4daZpfXrySmcBWNIL6VlfFacFRqV7CsvPsOFqcDAR/c16xbI63Eet0A3q CwJJD0KoyL0qA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201104_134509_890814_41CE4B72 X-CRM114-Status: GOOD ( 19.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-samsung-soc , Jan Kara , Pawel Osciak , KVM list , Daniel Vetter , LKML , DRI Development , Tomasz Figa , Linux MM , J??r??me Glisse , "open list:DMA BUFFER SHARING FRAMEWORK" , Daniel Vetter , Kyungmin Park , Andrew Morton , Mauro Carvalho Chehab , Dan Williams , Linux ARM , Marek Szyprowski Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 11/4/20 10:17 AM, Jason Gunthorpe wrote: > 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 > Well, the !CONFIG_ARCH_HAS_PTE_SPECIAL case points out in a comment that gup-fast is not *completely* unavailable there, so I don't think you want to shut it off like that: /* * If we can't determine whether or not a pte is special, then fail immediately * for ptes. Note, we can still pin HugeTLB and THP as these are guaranteed not * to be special. * * For a futex to be placed on a THP tail page, get_futex_key requires a * get_user_pages_fast_only implementation that can pin pages. Thus it's still * useful to have gup_huge_pmd even if we can't operate on ptes. */ thanks, -- John Hubbard NVIDIA _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel