Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1491228imw; Tue, 5 Jul 2022 10:22:02 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v2uRKChfo4l+9W8/XO5Kat113fTYJKxAQUYm5lB6knbV02fStr8ZsICecpRCfPOfFVZaP5 X-Received: by 2002:a63:ed48:0:b0:40d:9866:6834 with SMTP id m8-20020a63ed48000000b0040d98666834mr30281236pgk.324.1657041722330; Tue, 05 Jul 2022 10:22:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657041722; cv=none; d=google.com; s=arc-20160816; b=gYrSOKR5m6kLYDEUB1qAxs66vdWVQwcHh2j4OmIW5+rRCUW+Zv3UI82GyQ5+sWnz3+ VqZOugbHuzDIgPuI6OuYwdhqmRRc/MBWg35Ue3qvNvmXjTGUZUw99JpKF4bEiD4tA2DH HRyRFXRNwxw7qplGE9zx7OuBAO4J+GtGriwIr9SJgQitYZQDuhpD3MzZ6t6aT1TNADTt Art1AWr049+OhYXs3WO2trEZfLzvt4qtNhJvHCNIFbH4UyTEdnW+b6xZYWkTwjgWlrSW pXVXV4m5jy2xZuPdpQf3NPXceie2cVjyAhiVb3t5v5VUaYR/nyPxEpBgYDPqXQxKwbJ5 rvfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=7NxEUOhBA/vpCLtgBoaHFhHtEAgPzmWy1pdQgH0j92E=; b=FY64TO9+vhV6O8PQKLsKA8cDWzXtawQmizJWe0epo9QSfYVftSy+yXJuA3tsyxHTDY OYqd5Zh5X/YjFJr7lL/FO7n6T5ZCIMN9bbF797B8lESF8dccaT3Mm+dwqi/2BfTyDQPn m9ArlEg8OeGfTKzTtnpXf8L1H/ADB79isaZtpyM7z72wRsbrrkA1otbVJZkWBqoWHB6K Ht8kW8g/qv6LoKFaUC7zUWQ8pYyQBu4MA/vZ4neBi+E6LHNbG2EYD5gVdbZoU7Dvp3zF JM9uYu5fbcNOTMXp1R1LoVNtQ3t2mTE+VHJ0CRw0j4UBM5YyoIB5hzec9FqKIKlXfS8J jXjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z1-20020a170902ee0100b0016be51adc98si7581783plb.423.2022.07.05.10.21.47; Tue, 05 Jul 2022 10:22:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233049AbiGEQnV (ORCPT + 99 others); Tue, 5 Jul 2022 12:43:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230013AbiGEQnU (ORCPT ); Tue, 5 Jul 2022 12:43:20 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47CB81CB3F; Tue, 5 Jul 2022 09:43:19 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 31F3168AA6; Tue, 5 Jul 2022 18:43:15 +0200 (CEST) Date: Tue, 5 Jul 2022 18:43:15 +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 Subject: Re: [PATCH v7 20/21] PCI/P2PDMA: Introduce pci_mmap_p2pmem() Message-ID: <20220705164315.GB14484@lst.de> References: <20220615161233.17527-1-logang@deltatee.com> <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> 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) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 05, 2022 at 10:41:52AM -0600, Logan Gunthorpe wrote: > Using sysfs means we don't need all the messy callbacks from the nvme > driver, which is a plus. But I'm not sure how we'd get or unmap the > mapping of a sysfs file or avoid the anonymous inode. Seems with the > existing PCI resources, it uses an bin_attribute->f_mapping() callback > to pass back the iomem_get_mapping() mapping on file open. > revoke_iomem() is then used to nuke the VMAs. I don't think we can use > the same infrastructure here as that would add a dependency on > CONFIG_IO_STRICT_DEVMEM; which would be odd. And I'm not sure whether > there is a better way. Why can't we do the revoke on the actual sysfs inode?