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=-6.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 EA450C2D0A3 for ; Tue, 3 Nov 2020 22:09:50 +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 97F992080D for ; Tue, 3 Nov 2020 22:09:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=intel-com.20150623.gappssmtp.com header.i=@intel-com.20150623.gappssmtp.com header.b="T+/A6+J6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 97F992080D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com 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 C21146E903; Tue, 3 Nov 2020 22:09:49 +0000 (UTC) Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by gabe.freedesktop.org (Postfix) with ESMTPS id E884289C6E for ; Tue, 3 Nov 2020 22:09:47 +0000 (UTC) Received: by mail-ed1-x543.google.com with SMTP id a15so11363337edy.1 for ; Tue, 03 Nov 2020 14:09:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WO1e+L++wPESWfr9nzOE54SCt7afrEsmsB9fEuoYvbI=; b=T+/A6+J62VDvQMKYPtVg2CtBW5xawhHVZqWOERIyixTczN4MfytqxhoJQJOcs2790L sj4ZJgiKijp3n63RZQtMlQ3es9rYo1weSDlwxcJm5Ag+lH4tps5I28z8LxvfwKmYtzJJ /7ODS6RyMh7GrhkYAYzKWrZUgtjo08ShY2d8lFIlqSiQY56zEC4lJ332rH1cpQ0Jikk9 7t5YiToX4pGXA3cBIa8hr/lWANYeeU9HgWErCB0IiUFAAt6bSVSfurD3RBJy3BliIelp YL3WFMt/TsTNhYtMeHyiS4JaRXQkTDS7Em1++6Jk3gmVGF0kwFa501K00ou4nDd0zP9v pO8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WO1e+L++wPESWfr9nzOE54SCt7afrEsmsB9fEuoYvbI=; b=ROBXMcGX+g9xw/FQMqHNRrczi6/Z3r1aKJoV9R5EWr31NZasopmd/A1oS/BpTr25aF gNah7bcJZk4OpfeYwEG8Oz6EMxk7BmjeWxsKeScAQCdkHfapN+NMmHwwnOW8dY0F4iFe pUFosBEc9jRhAXo2lIws8iBDW30t0iBCSrERTPurjoHazrz9mJZpIfbEwTQ0idxrgpU8 dxh0iQzOpZ76qyNCvAB4Z7cs2t7udaNjxtzpc0BmCkAh3W1nheYfZB8ccWQ+0XNmdIZN XM+WynPDVVQlgzHIpFnLF9mJSrdrigXhOrz/5RVPL2AuaUpUpzCBcsHzcbki1Z/nqach wwPw== X-Gm-Message-State: AOAM533JFs9+gniwxg5VuhqZpW4/HAsC9s3kYwH9Xbr8t58GzIeVG2uT nPqxkMeZ/psEv6Pl8Y1UkHyqn0FID2SsCLc1P9+c7Q== X-Google-Smtp-Source: ABdhPJz1NDE7PM2O7672wRWt1a0mL/+PL68eDdfq2Oj69hckQbQldL+V0lbGY3zFDyAcHIRlbnAQxlg/ZySh5dCl9Ns= X-Received: by 2002:aa7:d843:: with SMTP id f3mr24583081eds.354.1604441386651; Tue, 03 Nov 2020 14:09:46 -0800 (PST) MIME-Version: 1.0 References: <20201030100815.2269-12-daniel.vetter@ffwll.ch> <20201103212840.GA266427@bjorn-Precision-5520> In-Reply-To: <20201103212840.GA266427@bjorn-Precision-5520> From: Dan Williams Date: Tue, 3 Nov 2020 14:09:35 -0800 Message-ID: Subject: Re: [PATCH v5 11/15] PCI: Obey iomem restrictions for procfs mmap To: Bjorn Helgaas 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-samsung-soc , Jan Kara , Kees Cook , KVM list , Jason Gunthorpe , Daniel Vetter , Linux PCI , LKML , DRI Development , Linux MM , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , John Hubbard , Bjorn Helgaas , Daniel Vetter , Andrew Morton , Linux ARM , "Linux-media@vger.kernel.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, Nov 3, 2020 at 1:28 PM Bjorn Helgaas wrote: > > On Fri, Oct 30, 2020 at 11:08:11AM +0100, Daniel Vetter wrote: > > There's three ways to access PCI BARs from userspace: /dev/mem, sysfs > > files, and the old proc interface. Two check against > > iomem_is_exclusive, proc never did. And with CONFIG_IO_STRICT_DEVMEM, > > this starts to matter, since we don't want random userspace having > > access to PCI BARs while a driver is loaded and using it. > > > > Fix this by adding the same iomem_is_exclusive() check we already have > > on the sysfs side in pci_mmap_resource(). > > > > References: 90a545e98126 ("restrict /dev/mem to idle io memory ranges") > > Signed-off-by: Daniel Vetter > > This is OK with me but it looks like IORESOURCE_EXCLUSIVE is currently > only used in a few places: > > e1000_probe() calls pci_request_selected_regions_exclusive(), > ne_pci_probe() calls pci_request_regions_exclusive(), > vmbus_allocate_mmio() calls request_mem_region_exclusive() > > which raises the question of whether it's worth keeping > IORESOURCE_EXCLUSIVE at all. I'm totally fine with removing it > completely. Now that CONFIG_IO_STRICT_DEVMEM upgrades IORESOURCE_BUSY to IORESOURCE_EXCLUSIVE semantics the latter has lost its meaning so I'd be in favor of removing it as well. _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel