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.8 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,URIBL_BLOCKED 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 20328C388F2 for ; Thu, 22 Oct 2020 11:43:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 640F22227F for ; Thu, 22 Oct 2020 11:43:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="W2W63+Km" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 640F22227F 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 B5BF36B005D; Thu, 22 Oct 2020 07:43:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B320E6B0062; Thu, 22 Oct 2020 07:43:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9D36B6B0068; Thu, 22 Oct 2020 07:43:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0200.hostedemail.com [216.40.44.200]) by kanga.kvack.org (Postfix) with ESMTP id 6E0E16B005D for ; Thu, 22 Oct 2020 07:43:48 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 08CF61EE6 for ; Thu, 22 Oct 2020 11:43:48 +0000 (UTC) X-FDA: 77399376936.30.ant69_24028e727250 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id D4088180B3C83 for ; Thu, 22 Oct 2020 11:43:47 +0000 (UTC) X-HE-Tag: ant69_24028e727250 X-Filterd-Recvd-Size: 5378 Received: from mail-qv1-f66.google.com (mail-qv1-f66.google.com [209.85.219.66]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Thu, 22 Oct 2020 11:43:47 +0000 (UTC) Received: by mail-qv1-f66.google.com with SMTP id cv1so661462qvb.2 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=Vl/pGe0fBKf7IsFaWt7bMzlD4kDtWndV8MzxT62G59/X4I+zNPhOsHwRrDl2F0atmz GTYMoL0A5yS5zI66c0axWm25NY14GWsMKHNvQRvHONwOGWY4k5Vp3ar79HXYmpGIsijr QqL0PU0V0r4mI6LJ/IIQ+kRRDxWjp53y3GP5KYSLrzxsa4sX86AeUDgnY+SDQFb9Erzj zlpd8X56EV2GkohAu0ciN7ZV+su3ujXGb0gUK8Kh014Wktth9pXi4GKmViMovbhRwx2v WTUSskMKO+JIkT2yYiJqg0/iHkbFyPUMUvNSZy9oiDFqFXzTPkAmHoghllAEmn9FuPOb a+jA== X-Gm-Message-State: AOAM532+eLLJ/RmcKOhY0CF9KXcMCxWX4zWriyvyXDHbM3POw1ze1nYg uGsARN1tc/52pZCThubrzom9rg== X-Google-Smtp-Source: ABdhPJw6OYYGIWsKIpwZGlvXqWx4K8ij3H0LBJb/eEFtxBXIO8uo2emBiN1PSKDxC0xVD0g026FmxA== 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: 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 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