Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6041131imu; Wed, 30 Jan 2019 07:50:14 -0800 (PST) X-Google-Smtp-Source: ALg8bN5UP+SHrE0iLp9ZxKj3oiFr72lfec7BQfZGGXczjXz6KLqEk8Vb9QBQQX6VoCZenzRu5Bkg X-Received: by 2002:a62:99dd:: with SMTP id t90mr30770239pfk.179.1548863414280; Wed, 30 Jan 2019 07:50:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548863414; cv=none; d=google.com; s=arc-20160816; b=UELez5PO00w/dulx8eSFgNjBOQNkXDq8DxgNYOMchMJHU/TQMMqhmmeGKB1j1/nEEP 157mSVUvErP17Ot90lLeiS26MGlsXWir+OdKgpFkyvboStLIgPrda+hbPbuLIcS6PfDM I2tTtd5Zj373ddGZXyx7z3wqfDFI6ZoWX9y2TzPNqV9BpO7sewpoL0049/AiZBQBIYrn LlAM3Gx53Op7ranAMU1mo9L5ehKzuW1kAgPwQ4MI2cLf+OwWGd+I80j9SldEY4Dc93Ee 05gCm9YR1bMRa67rGbsKH0GOh2aQlnxOH3dyRgttsWW0Z99yULQ6lEBBGP3fmY1hAfch RODg== 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; bh=kY7jAJk7Jdb0JLqR74DNGNRbyltdoLCYY2bKrEmARrs=; b=eQ6wJhDhh65+S8B6Zm+U1i73MbucZb5G6E238hBz26a9Q3JrfLml5V3pHjfQafaCrC 5wk2gRot74O9ma1Lsn5P/F1UuAnq3WGq9DFiPael0t/ljqQc/1r5JuWGwp62XT6e2k5E cJBF91UmAhgcN6DsbA2mBtp928zwfxnyKp3Nc1sIt184EEZVNnOwuS7tAZU5BVSimQRT mId70siiUg1VaPJImdQNPkcLl5m4bBi8LQafujGjNVxixI02FRMrKTko18hQ5W67cD81 pCsDC12aNXUsm8NqdxGT/CRvJCZjOEpfucGAnYj86MppZRMvE1KbLTr0Z4DPJMbztIyA Dy1A== 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 x128si1820303pfb.128.2019.01.30.07.49.57; Wed, 30 Jan 2019 07:50:14 -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 S1731555AbfA3PtU (ORCPT + 99 others); Wed, 30 Jan 2019 10:49:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58906 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726439AbfA3PtU (ORCPT ); Wed, 30 Jan 2019 10:49:20 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9F4787AEA1; Wed, 30 Jan 2019 15:49:19 +0000 (UTC) Received: from redhat.com (ovpn-126-0.rdu2.redhat.com [10.10.126.0]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C7FEC5D6A6; Wed, 30 Jan 2019 15:49:17 +0000 (UTC) Date: Wed, 30 Jan 2019 10:49:16 -0500 From: Jerome Glisse To: Christoph Hellwig Cc: Jason Gunthorpe , Logan Gunthorpe , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , "Rafael J . Wysocki" , Bjorn Helgaas , Christian Koenig , Felix Kuehling , "linux-pci@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , Marek Szyprowski , Robin Murphy , Joerg Roedel , "iommu@lists.linux-foundation.org" Subject: Re: [RFC PATCH 3/5] mm/vma: add support for peer to peer to device vma Message-ID: <20190130154915.GB3177@redhat.com> References: <20190129193250.GK10108@mellanox.com> <99c228c6-ef96-7594-cb43-78931966c75d@deltatee.com> <20190129205749.GN3176@redhat.com> <2b704e96-9c7c-3024-b87f-364b9ba22208@deltatee.com> <20190129215028.GQ3176@redhat.com> <20190129234752.GR3176@redhat.com> <655a335c-ab91-d1fc-1ed3-b5f0d37c6226@deltatee.com> <20190130041841.GB30598@mellanox.com> <20190130080006.GB29665@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190130080006.GB29665@lst.de> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 30 Jan 2019 15:49:20 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 30, 2019 at 09:00:06AM +0100, Christoph Hellwig wrote: > On Wed, Jan 30, 2019 at 04:18:48AM +0000, Jason Gunthorpe wrote: > > Every attempt to give BAR memory to struct page has run into major > > trouble, IMHO, so I like that this approach avoids that. > > Way less problems than not having struct page for doing anything > non-trivial. If you map the BAR to userspace with remap_pfn_range > and friends the mapping is indeed very simple. But any operation > that expects a page structure, which is at least everything using > get_user_pages won't work. > > So you can't do direct I/O to your remapped BAR, you can't create MRs > on it, etc, etc. We do not want direct I/O, in fact at least for GPU we want to seldomly allow access to object vma, so the less thing can access it the happier we are :) All the GPU userspace driver API (OpenGL, OpenCL, Vulkan, ...) that expose any such mapping with the application are very clear on the limitation which is often worded: the only valid thing is direct CPU access (no syscall can be use with those pointers). So application developer already have low expectation on what is valid and allowed to do. Cheers, J?r?me