Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5732567pxu; Thu, 22 Oct 2020 09:39:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSsmj/CX8M0qudAz57YhhGIV55nXkmJ0vuZ/IVJlAj58pAxSIrYpcEwL9EHWsN0fxPxYrU X-Received: by 2002:a17:906:490e:: with SMTP id b14mr3028927ejq.268.1603384780399; Thu, 22 Oct 2020 09:39:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603384780; cv=none; d=google.com; s=arc-20160816; b=QWJ65k4zI3UOiW7er5GwFEbhdSSKn1NJQTKJcdpbHd0HFOkXlMjG092WZLPUqpd6Tg zM1x1YWS8q4OsWr8qPslkKc/pPEakGc3G9jTsEq1j4I0RZh8cWuOdT8fWlFQSm8Ro/NM wW2n1+3YbKebcUsVRVN1FWMOsP98N6L213+/iejUvIJ7sdfxOOFXT1nf9okGcqlgU23O 2zKziU/SQ2nIvcqHrOQXcBFyXVBlnFcEI91/mf5TYbtupz7iGdsYWFZuz+wdOMwJ+g6O Snj2Ws2AnCh/ZoFNS9oKK7E7tcLWV9kBFwyadCWB+HHBxT34BrvcouIwaBpOvQTKJ0IB m+JQ== 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=Tn5VStmyr19eg0AHWkg65WyZIMHvKO6plAVuAqOgPDQ=; b=uDf6eqUWR2QvkQ+enhxu67RlxCBBoi8/PafpXzH4XVtja+MvHszkoxien3Xr9YtduY ZgdSGy9B8yBqqyyHeRUUf9kZ1t7T5ps1ERW2NkBFIuVLlF33kw7LwD4JIvlHHZ12wDwh 3R9TsXgrYxzryQxg9Tc6KdmfmCZk8zB5sGV/ywJ9tVsJiHe2u/fmhVUPhLxTA352bOZ6 IYpPoACH9xVgbvndlPIpNo7hfJxJAizZfO637FEo67obmKDY0EM9yfSm1HOC0xkHH2nm YlO0kNHHLgqEu4TPuKXXR1rSz5pnhtFumPmhaeXwVkVP+0eXqeC5IOGQDzFqkPSpNSpU +0ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=W2W63+Km; 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 y20si1231276ejm.593.2020.10.22.09.39.18; Thu, 22 Oct 2020 09:39:40 -0700 (PDT) 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=W2W63+Km; 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 S2897506AbgJVLnt (ORCPT + 99 others); Thu, 22 Oct 2020 07:43:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2897499AbgJVLns (ORCPT ); Thu, 22 Oct 2020 07:43:48 -0400 Received: from mail-qv1-xf42.google.com (mail-qv1-xf42.google.com [IPv6:2607:f8b0:4864:20::f42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AE53C0613D6 for ; Thu, 22 Oct 2020 04:43:47 -0700 (PDT) Received: by mail-qv1-xf42.google.com with SMTP id f5so654294qvx.6 for ; Thu, 22 Oct 2020 04:43:47 -0700 (PDT) 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=Tn5VStmyr19eg0AHWkg65WyZIMHvKO6plAVuAqOgPDQ=; b=W2W63+Km46WNPYtkSR3igfnV7TEUq5madmsiNOsLljJ4hXhwY+tNpYNU0U98RMc/Ra N/OqT1bclh4ytLL1rVRfHDNQXuCClycUHEstVDTB13O2SeX7rcenP16ZDtQZwB1W1jcc qY+V9dfylqzLN5PiDQabSjcYMeIPMV8H3MvDBIvqP9uVDzx0l3+DGSbt51z70fKAGBps MOgHN8p+THySDXKSzKDRAxFER+JAglmr7hGRyvf9N5t7jpnIarxCymOKiSFfwhwoQKR+ 3E88SiMtx1h9HdY+LUkd3T5LmcI1LTVNdrFdFYFYlKXO0Wntp7OMh6vxttQFR1tsYI0Q kJBg== 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=Tn5VStmyr19eg0AHWkg65WyZIMHvKO6plAVuAqOgPDQ=; b=boQZ/HoheI2gE4q57im5H61agM0hy3lwR60z0STrIY4sd5lyKY3IN2vcvPF2JNb3jj OsNTIkQ49AqgaXUTN5XiGE3rELsEab5prfYJQ1Ieds5UOUGiHGUoLAd46oCYU8mgL1SW bXoI+fmDF6THomkRJuq8214YBLrdfcBO54swcs0ZrIy/2Du89A64mFmnflYM623LLron WFIabQ2jAwy5/6Cfdb9e2CftVwQ28n4NtaIG2p9K6dq54qXLtQ+vi/HTexkieRdgaH6E BlNzUPIPfjDMLBce4Qco3elCQshFx04lL6aFYnqlmVp3JEQUmjSAl4R9k7l9xF8S24f2 c8XA== X-Gm-Message-State: AOAM533dZDNs72MnFEjpuwrRIur8aRKSWe9NZtLiJj3pGZLG9lzuuWZh y1s6blezczj89XhtCzGLQz1Thw== X-Received: by 2002:ad4:45a5:: with SMTP id y5mr1935405qvu.40.1603367026713; Thu, 22 Oct 2020 04:43:46 -0700 (PDT) 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 l25sm820821qtf.18.2020.10.22.04.43.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 04:43:45 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kVZ0T-0040bW-1W; Thu, 22 Oct 2020 08:43:45 -0300 Date: Thu, 22 Oct 2020 08:43:45 -0300 From: Jason Gunthorpe To: Daniel Vetter Cc: DRI Development , LKML , KVM list , Linux MM , Linux ARM , linux-samsung-soc , "open list:DMA BUFFER SHARING FRAMEWORK" , linux-s390 , Daniel Vetter , Kees Cook , Dan Williams , Andrew Morton , John Hubbard , =?utf-8?B?SsOpcsO0bWU=?= Glisse , Jan Kara , Bjorn Helgaas , Linux PCI , Daniel Vetter Subject: Re: [PATCH v3 12/16] PCI: Obey iomem restrictions for procfs mmap Message-ID: <20201022114345.GO36674@ziepe.ca> References: <20201021085655.1192025-1-daniel.vetter@ffwll.ch> <20201021085655.1192025-13-daniel.vetter@ffwll.ch> <20201021125030.GK36674@ziepe.ca> <20201021151352.GL36674@ziepe.ca> <20201021163702.GM36674@ziepe.ca> <20201021232022.GN36674@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 22, 2020 at 09:00:44AM +0200, Daniel Vetter wrote: > On Thu, Oct 22, 2020 at 1:20 AM Jason Gunthorpe wrote: > > > > On Wed, Oct 21, 2020 at 09:24:08PM +0200, Daniel Vetter wrote: > > > On Wed, Oct 21, 2020 at 6:37 PM Jason Gunthorpe wrote: > > > > > > > > On Wed, Oct 21, 2020 at 05:54:54PM +0200, Daniel Vetter wrote: > > > > > > > > > The trouble is that io_remap_pfn adjust vma->pgoff, so we'd need to > > > > > split that. So ideally ->mmap would never set up any ptes. > > > > > > > > /dev/mem makes pgoff == pfn so it doesn't get changed by remap. > > > > > > > > pgoff doesn't get touched for MAP_SHARED either, so there are other > > > > users that could work like this - eg anyone mmaping IO memory is > > > > probably OK. > > > > > > I was more generally thinking for io_remap_pfn_users because of the > > > mkwrite use-case we might have in fbdev emulation in drm. > > > > You have a use case for MAP_PRIVATE and io_remap_pfn_range()?? > > Uh no :-) So it is fine, the pgoff mangling only happens for MAP_PRIVATE Jason