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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E08FC433EF for ; Tue, 5 Jul 2022 16:50:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 887FA6B0071; Tue, 5 Jul 2022 12:50:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8115E6B0073; Tue, 5 Jul 2022 12:50:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6B1B76B0074; Tue, 5 Jul 2022 12:50:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 593846B0071 for ; Tue, 5 Jul 2022 12:50:45 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 2833724E for ; Tue, 5 Jul 2022 16:50:45 +0000 (UTC) X-FDA: 79653635250.10.1BEB552 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf18.hostedemail.com (Postfix) with ESMTP id 929F21C0058 for ; Tue, 5 Jul 2022 16:50:44 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id C89A168AA6; Tue, 5 Jul 2022 18:50:39 +0200 (CEST) Date: Tue, 5 Jul 2022 18:50:39 +0200 From: Christoph Hellwig To: Logan Gunthorpe Cc: Christoph Hellwig , 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 , Greg Kroah-Hartman Subject: Re: [PATCH v7 20/21] PCI/P2PDMA: Introduce pci_mmap_p2pmem() Message-ID: <20220705165039.GB14566@lst.de> References: <20220615161233.17527-21-logang@deltatee.com> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657039844; a=rsa-sha256; cv=none; b=HqSRq+c9rxXzrPH4E8fLlQE5/Z8xj2XKWFCPC2rkpnyWl8cmzf6Gl9aeNp1m389hxLSM4U XaL1XuXnoUBlhGwpPAq+fqQggUyYrTzvK4aPqNhDg5bKIn2LX234npRdNCEl5ybY19v+76 XwBck9IwFK5l8OoTvRs4ce/z29GVOIo= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; dmarc=none; spf=none (imf18.hostedemail.com: domain of hch@lst.de has no SPF policy when checking 213.95.11.211) smtp.mailfrom=hch@lst.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657039844; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VFHBqUHwwYoA8FWyemsM9JmzLGwAB1VPkIrcaKdDl6s=; b=fUHsMaTrmvvOtamVFvA+H+T/LDTyqPHtzyV+VPSMo5RaKlqbRTROeEAMn9/HNC58U8J5pG Mt1jxZRfj0A5mpGsE9dJKV8vYejf30OwCIbkFeBWIwTelsOEYWHe2k9U1sqw/DkuQLxK8u JeHrWZ/omtbM3+i8q07hF2D2sXiiAi4= Authentication-Results: imf18.hostedemail.com; dkim=none; dmarc=none; spf=none (imf18.hostedemail.com: domain of hch@lst.de has no SPF policy when checking 213.95.11.211) smtp.mailfrom=hch@lst.de X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 929F21C0058 X-Rspam-User: X-Stat-Signature: 4h1yrxqxfic1wu6xzggrbg1msubm84xf X-HE-Tag: 1657039844-561687 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: [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] 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.