Received: by 10.223.185.116 with SMTP id b49csp7907166wrg; Thu, 1 Mar 2018 13:19:45 -0800 (PST) X-Google-Smtp-Source: AG47ELv4an3ooYCY6SQgq5MsdDRS80ldHIwFNvmrm5WRUIMSp6IDYlDsczQrTwxa1Fa8JFcYnpvv X-Received: by 10.98.157.18 with SMTP id i18mr3339571pfd.62.1519939185407; Thu, 01 Mar 2018 13:19:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519939185; cv=none; d=google.com; s=arc-20160816; b=scibtGTNE5sddNt/9w9tn4UaU4YTRq51ML3qXw6S5pH6Tr11ROk1ELviUBZFj0rCen WndCFxC7O7P/dCRh5BnssFE9FZFbxg5rsf0f/fYp3XveVmXT+XNSBE5DxIveQCmK4I5F BhaaJYu9d9rK8XZMPWMqZdWyTSmLP+aDNmANzFOLhTpdoffxcK7eUBZl6Qn6/3kQu3GV p4GzLoTHni+hOtzChhe22GQ5Eg1loTTpmaZRwp6HUEvUc8xx/M/Dj90/8HC0X6+kLEUX a6M3CUflynienSkEBb6IbjbA9aG39g4YndkVjLQjMPZDpXWcd5j+VTUn2LJhVPZKk46g a0xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=9q8UxufD006hu4zS/9HRXcNWUiJbRBX4GsSc09OzVxI=; b=bpO7zDrWNyoLc7GeHNTvFbPJbViKFcTR9PkzZbxQuGYsg3BhSh9PhtC4NdQhbs2zBO SnxTXIPvIskqhVHHBaU6tpFLuf6TZAkDERmIPpg9pokDLumhWGlVv3wq/uI8/m8mcW2u NHdVa9It/GvWQ5zvNP+DhDAKdQM6yyineGHT7T6fCp5ZLA1Vfki7oWEpxh66PiZZIfmz 4qG4ZrINnJJEa6fF2KtmJn7/2rAJt2nDEUSmzmyqtg2xeNev38XprjUiBN2eofy0RFfT rUQhzetpYJJrLFFdKl0s4U1W/Zi4DDmviZKmwCXDnPiTKdCLfNU3Blhf56PlGwWZgO/V Po+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b12si2922619pgq.773.2018.03.01.13.19.30; Thu, 01 Mar 2018 13:19:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034218AbeCAVSZ (ORCPT + 99 others); Thu, 1 Mar 2018 16:18:25 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:48752 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1033189AbeCAVSX (ORCPT ); Thu, 1 Mar 2018 16:18:23 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EAB184015177; Thu, 1 Mar 2018 21:18:22 +0000 (UTC) Received: from redhat.com (ovpn-124-164.rdu2.redhat.com [10.10.124.164]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A27C89C07C; Thu, 1 Mar 2018 21:18:19 +0000 (UTC) Date: Thu, 1 Mar 2018 16:18:18 -0500 From: Jerome Glisse To: Logan Gunthorpe Cc: benh@au1.ibm.com, Dan Williams , Linux Kernel Mailing List , linux-pci@vger.kernel.org, linux-nvme@lists.infradead.org, linux-rdma , linux-nvdimm , linux-block@vger.kernel.org, Stephen Bates , Christoph Hellwig , Jens Axboe , Keith Busch , Sagi Grimberg , Bjorn Helgaas , Jason Gunthorpe , Max Gurtovoy , Alex Williamson , Oliver OHalloran Subject: Re: [PATCH v2 00/10] Copy Offload in NVMe Fabrics with P2P PCI Memory Message-ID: <20180301211817.GC6742@redhat.com> References: <20180228234006.21093-1-logang@deltatee.com> <1519876489.4592.3.camel@kernel.crashing.org> <1519876569.4592.4.camel@au1.ibm.com> <1519938210.4592.30.camel@au1.ibm.com> <1de70207-40ce-29f0-6093-337112852475@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1de70207-40ce-29f0-6093-337112852475@deltatee.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 01 Mar 2018 21:18:23 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 01 Mar 2018 21:18:23 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jglisse@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 01, 2018 at 02:11:34PM -0700, Logan Gunthorpe wrote: > > > On 01/03/18 02:03 PM, Benjamin Herrenschmidt wrote: > > However, what happens if anything calls page_address() on them ? Some > > DMA ops do that for example, or some devices might ... > > Although we could probably work around it with some pain, we rely on > page_address() and virt_to_phys(), etc to work on these pages. So on x86, > yes, it makes it into the linear mapping. This is pretty easy to do with HMM: unsigned long hmm_page_to_phys_pfn(struct page *page) { struct hmm_devmem *devmem; unsigned long ppfn; /* Sanity test maybe BUG_ON() */ if (!is_device_private_page(page)) return -1UL; devmem = page->pgmap->data; ppfn = page_to_page(page) - devmem->pfn_first; return ppfn + devmem->device_phys_base_pfn; } Note that last field does not exist in today HMM because i did not need such helper so far but this can be added. Cheers, J?r?me