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.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 D6F3AC4363A for ; Thu, 22 Oct 2020 07:27:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 4AECC20848 for ; Thu, 22 Oct 2020 07:27:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="c06LmWtB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4AECC20848 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9D0166F3D8; Thu, 22 Oct 2020 07:27:49 +0000 (UTC) Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by gabe.freedesktop.org (Postfix) with ESMTPS id A58426EDD2 for ; Wed, 21 Oct 2020 16:37:04 +0000 (UTC) Received: by mail-qk1-x742.google.com with SMTP id i22so3075024qkn.9 for ; Wed, 21 Oct 2020 09:37:04 -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=BzRdHxhoEjnpcVyZTB9k2I2+fkzcE70kBpksBajHHPg=; b=c06LmWtB/eBV/fSiYmdEtL9GPYUkBEwiw6eScZ5dk4Sur880r0RUDUdOasWQ2KsUGe bZgM/0p8jMLFa+ikbb0dWN5Ow5CevA+xGmpM9sZNHVumRdO1Tl6lKH78eEdBiQO/7MSc SyBxogrPHboOf7N/zRQinZbDgCQncGQf+B3tCHdeRI6jhJnIAAoc2n5M0i1ORD3y+prI vtMVVV6QAXuny3nyioqppKj86tWO1HhufpTOjkK/v2RsEfqLugKDikZxGHBEJZrzkhBg lGNMu1/vnxQxiUuVEAydazAgNl/YziHidKE+BchWShczAu98wiVxpsNR+uw83dVIq+/q VdCA== 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=BzRdHxhoEjnpcVyZTB9k2I2+fkzcE70kBpksBajHHPg=; b=np1v7m63xmaN0N/DVTbAcchBkmSYiqjiVYQUJAMzvNzG4zjq1qntwzhPou0VsUbzUY maLTX080w7IfkcLWmyW3jwq76PcwHFRTX0xnwvvRBsf4otJmRt+Jn+ZwxXNp5UcU6Sgg dgGtLqbYDSt2ZgXeKQQsw0AQJpeAHYDR9HrRG9+YL+walGaSl19A8WXp3nnvomSZoPDa uc2riKztLWOtGy45MD4xWsNWI3Cb6ilmZrn7UKuXyZZ/4xbRZrS5Xt2vHjg1RZ/+1XIb xwj7zuDmVRlqdink9GKezHlQ++ZgHrwygSYPD4+Hj5txVQAI1tDQ4FiERf6Nso1nyWlu d80w== X-Gm-Message-State: AOAM533EQXZvbcLS9p3uMIZVI+ieSShY4RYvTVauotMjlwCDBr5FDB+G 4QS05H91e8IyEZpg/eD4mf24Aw== X-Google-Smtp-Source: ABdhPJzGADmR3Upv87Rf5RxP6nvmSwt5ZnM0S0wnKL/4oE2AOzzQDQjF/MbwQajcSGEwpbzdpDuubQ== X-Received: by 2002:a37:4244:: with SMTP id p65mr3998477qka.141.1603298223560; Wed, 21 Oct 2020 09:37:03 -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 r58sm1532749qte.94.2020.10.21.09.37.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Oct 2020 09:37:02 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kVH6k-003YkE-3P; Wed, 21 Oct 2020 13:37:02 -0300 Date: Wed, 21 Oct 2020 13:37:02 -0300 From: Jason Gunthorpe To: Daniel Vetter Subject: Re: [PATCH v3 12/16] PCI: Obey iomem restrictions for procfs mmap Message-ID: <20201021163702.GM36674@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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailman-Approved-At: Thu, 22 Oct 2020 07:27:48 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-s390 , linux-samsung-soc , Jan Kara , Kees Cook , KVM list , Daniel Vetter , John Hubbard , LKML , DRI Development , Linux MM , =?utf-8?B?SsOpcsO0bWU=?= Glisse , Linux PCI , Bjorn Helgaas , Daniel Vetter , Dan Williams , Andrew Morton , Linux ARM , "open list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 guess one option would be if remap_pfn_range would steal the > vma->vm_ops pointer for itself, then it could set up the correct > ->install_ptes hook. But there's tons of callers for that, so not sure > that's a bright idea. The caller has to check that the mapping is still live, and I think hold a lock across the remap? Auto-defering it doesn't seem feasible. Jason _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel