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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20240CCA47B for ; Tue, 5 Jul 2022 17:22:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232216AbiGERWE (ORCPT ); Tue, 5 Jul 2022 13:22:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229779AbiGERWE (ORCPT ); Tue, 5 Jul 2022 13:22:04 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89D6512AD2; Tue, 5 Jul 2022 10:22:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 41EA6B8182F; Tue, 5 Jul 2022 17:22:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A3CBC341C7; Tue, 5 Jul 2022 17:22:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657041720; bh=2k+PI3826bV0JfafuKOYWZwzEmZ/6OWZBqa+5FOwKKU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eW0LSj5OCSMxFTwab7kOj8yB3ANUifdcIyjdDqyqljZ/iy8fnpSDRDB1hx7AhAPR2 x0qZP6dDTeDA8ifC5C2gTw8/5BH/5dH8LBx4m8NjuS/wZ8PPrtzbO2zUPRMEQWtCnE Ysh75bL4zKRSbMgqYVPy39v9+8C6x63MzOq+Bpnc= Date: Tue, 5 Jul 2022 19:21:58 +0200 From: Greg Kroah-Hartman To: Christoph Hellwig Cc: Logan Gunthorpe , Jason Gunthorpe , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, linux-pci@vger.kernel.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org, Stephen Bates , Dan Williams , Christian =?iso-8859-1?Q?K=F6nig?= , John Hubbard , Don Dutile , Matthew Wilcox , Daniel Vetter , Minturn Dave B , Jason Ekstrand , Dave Hansen , Xiong Jianxin , Bjorn Helgaas , Ira Weiny , Robin Murphy , Martin Oliveira , Chaitanya Kulkarni , Ralph Campbell , Bjorn Helgaas Subject: Re: [PATCH v7 20/21] PCI/P2PDMA: Introduce pci_mmap_p2pmem() Message-ID: References: <20220629064854.GD17576@lst.de> <99242789-66a6-bbd2-b56a-e47891f4522e@deltatee.com> <20220629175906.GU23621@ziepe.ca> <20220705075108.GB17451@lst.de> <20220705135102.GE23621@ziepe.ca> <20220705161240.GB13721@lst.de> <20220705164315.GB14484@lst.de> <20220705165039.GB14566@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220705165039.GB14566@lst.de> Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Tue, Jul 05, 2022 at 06:50:39PM +0200, Christoph Hellwig wrote: > [note for the newcomers, this is about allowing mmap()ing the PCIe > P2P memory from the generic PCI P2P code through sysfs, and more > importantly how to revoke it on device removal] We allow mmap on PCIe config space today, right? Why is this different from what pci_create_legacy_files() does today? > On Tue, Jul 05, 2022 at 10:44:49AM -0600, Logan Gunthorpe wrote: > > We might be able to. I'm not sure. I'll have to figure out how to find > > that inode from the p2pdma code. I haven't found an obvious interface to > > do that. > > I think the right way to approach this would be a new sysfs API > that internally calls unmap_mapping_range internally instead of > exposing the inode. I suspect that might actually be the right thing > to do for iomem_inode as well. Why do we need something new and how is this any different from the PCI binary files I mention above? We have supported PCI hotplug for a very long time, do the current PCI binary sysfs files not work properly with mmap and removing a device? thanks, greg k-h 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 Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A80F8C433EF for ; Tue, 5 Jul 2022 17:22:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 3456F60E78; Tue, 5 Jul 2022 17:22:09 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 3456F60E78 Authentication-Results: smtp3.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=eW0LSj5O X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1YYKs4cmPp0V; Tue, 5 Jul 2022 17:22:08 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id 0D61D60BC5; Tue, 5 Jul 2022 17:22:08 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 0D61D60BC5 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D4C77C0032; Tue, 5 Jul 2022 17:22:07 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6E8E6C002D for ; Tue, 5 Jul 2022 17:22:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 3B1EC60BC5 for ; Tue, 5 Jul 2022 17:22:06 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 3B1EC60BC5 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id n9kGyHXzhg-u for ; Tue, 5 Jul 2022 17:22:05 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org D2E9B60F16 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by smtp3.osuosl.org (Postfix) with ESMTPS id D2E9B60F16 for ; Tue, 5 Jul 2022 17:22:04 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1BA0EB8181F; Tue, 5 Jul 2022 17:22:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A3CBC341C7; Tue, 5 Jul 2022 17:22:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657041720; bh=2k+PI3826bV0JfafuKOYWZwzEmZ/6OWZBqa+5FOwKKU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eW0LSj5OCSMxFTwab7kOj8yB3ANUifdcIyjdDqyqljZ/iy8fnpSDRDB1hx7AhAPR2 x0qZP6dDTeDA8ifC5C2gTw8/5BH/5dH8LBx4m8NjuS/wZ8PPrtzbO2zUPRMEQWtCnE Ysh75bL4zKRSbMgqYVPy39v9+8C6x63MzOq+Bpnc= Date: Tue, 5 Jul 2022 19:21:58 +0200 From: Greg Kroah-Hartman To: Christoph Hellwig Subject: Re: [PATCH v7 20/21] PCI/P2PDMA: Introduce pci_mmap_p2pmem() Message-ID: References: <20220629064854.GD17576@lst.de> <99242789-66a6-bbd2-b56a-e47891f4522e@deltatee.com> <20220629175906.GU23621@ziepe.ca> <20220705075108.GB17451@lst.de> <20220705135102.GE23621@ziepe.ca> <20220705161240.GB13721@lst.de> <20220705164315.GB14484@lst.de> <20220705165039.GB14566@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220705165039.GB14566@lst.de> Cc: linux-pci@vger.kernel.org, Dave Hansen , linux-nvme@lists.infradead.org, Stephen Bates , linux-mm@kvack.org, Jason Ekstrand , Ira Weiny , Minturn Dave B , Martin Oliveira , Matthew Wilcox , Jason Gunthorpe , Chaitanya Kulkarni , Bjorn Helgaas , Daniel Vetter , Ralph Campbell , John Hubbard , linux-block@vger.kernel.org, Bjorn Helgaas , Dan Williams , Xiong Jianxin , Robin Murphy , linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Logan Gunthorpe , Christian =?iso-8859-1?Q?K=F6nig?= X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Tue, Jul 05, 2022 at 06:50:39PM +0200, Christoph Hellwig wrote: > [note for the newcomers, this is about allowing mmap()ing the PCIe > P2P memory from the generic PCI P2P code through sysfs, and more > importantly how to revoke it on device removal] We allow mmap on PCIe config space today, right? Why is this different from what pci_create_legacy_files() does today? > On Tue, Jul 05, 2022 at 10:44:49AM -0600, Logan Gunthorpe wrote: > > We might be able to. I'm not sure. I'll have to figure out how to find > > that inode from the p2pdma code. I haven't found an obvious interface to > > do that. > > I think the right way to approach this would be a new sysfs API > that internally calls unmap_mapping_range internally instead of > exposing the inode. I suspect that might actually be the right thing > to do for iomem_inode as well. Why do we need something new and how is this any different from the PCI binary files I mention above? We have supported PCI hotplug for a very long time, do the current PCI binary sysfs files not work properly with mmap and removing a device? thanks, greg k-h _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu