Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1521834pxb; Wed, 4 Nov 2020 11:10:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJwGYi0qyVp+cy3gtWRw0o1tY3wARRwFbc60TUIV70/AHNrEHrSKzmGdEZ/jRsuGLY+YaJ4A X-Received: by 2002:a05:6402:a57:: with SMTP id bt23mr17073033edb.62.1604517020195; Wed, 04 Nov 2020 11:10:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604517020; cv=none; d=google.com; s=arc-20160816; b=HZKt7o3khHzIpE2nFJbR/Km81kolua5GRH9mwKxPLWaXX9VupAxAkIYdbv4gEGt491 /WICorYZW3771rf2z93k3a+zkArdJ2aY7o5k8idnyGiKGZsDAcLBjLledCVQ7E+HZiqx G84iVDK13k5CpYYPQYXckStNyE1+VfF4/hhqy9bpQ6slXz9D+OteX/9Esd+yUzLJu2It eM2qryvp8MA13beMQ63854gWUs4E6hZqEXyGxnjampBHPN33WpHDoqNCpt3EdqqzrQxs j/glJjV+I34iOTvgCIj9h3Q5l+XvvmMhS+TobW97B37IUcyetkooP6OEh3wZmELJTN5J IMYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0IlAXzxWFTQTUuhmHtEVnKs2xhR6KwI7WPZxiLpUe5M=; b=Vxktyy0br3D5uc3SEUrf8x2ACauAVSE3WaMz17QXsqTSjo6mG/tS99XC4oUSVptDYM m/GbfZCjNnr8I1hNzAcDm0eX3zJdDRKr8BZ3iNUKY4qCGoO3IMxYB1O5uNJA4VR/mUKB htC3UtqN+DaFW+xwNSu4HLyMo6OLsjQinPKlI+xfQ932tJDP7PcHDxD+zB73qBODNI8g ffAsfMFYZHuoCY8Bzh7DQ5uHoMZK8CBGD72Z4Y68l0kAKxzvcSG5gvlZfSDbrDn46Goh IJ7w0as98B4ZjiLiJHrFsdeWkCWKzLii3VRDWE1avBpHiCgd9IBkF8gaBfZyt0QmPkEB qFcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=nBv9S+jw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 5si2022309edh.141.2020.11.04.11.09.56; Wed, 04 Nov 2020 11:10:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=nBv9S+jw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725946AbgKDSRL (ORCPT + 99 others); Wed, 4 Nov 2020 13:17:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732239AbgKDSRK (ORCPT ); Wed, 4 Nov 2020 13:17:10 -0500 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7713EC061A4C for ; Wed, 4 Nov 2020 10:17:10 -0800 (PST) Received: by mail-qt1-x841.google.com with SMTP id c5so12874809qtw.3 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=dD/wCoPOxX8wnPkacRjndr4H92k5xJ4LywLemLOp5C+TME6tcwIPgfrocqcuDXUbaZ 1qgggu4YrtOzB2xUJMMDWJMjb6fSxSsF5VyapYDBy/eI+biiAuJ//u8pjqjPH3hVTuia c4oMXBeyfFNN3nZBZ+h7BT50z5CtklPmExR1qHq1fARFTlduFDj41GT+bkP1r3IM/luG /oErvASLFQkqgJXlILzKMQ6AmFFqyUlYt3b3tLuZlu41Jeq9twbvBebiCIqv1YMv1eJD Uwkps7xy0sFKOHh54GLWOrf0levJdZbPbsi4OUwwhfCbSKM51uWqZlFSmXrZhnDEWjmR hzjw== X-Gm-Message-State: AOAM531l4L4ZF4wtBewJA1Ia5a94GtGC2ydM4UsMwGmZVZ+DYtyDQT8y fVDDYOhqUbSKNUXD1vdmFtYUOw== 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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