linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
To: Jonathan Cameron <jonathan.cameron@huawei.com>,
	Jason Gunthorpe <jgg@ziepe.ca>
Cc: "liguozhu@hisilicon.com" <liguozhu@hisilicon.com>,
	"Leon Romanovsky" <leon@kernel.org>,
	"Kenneth Lee" <nek.in.cn@gmail.com>,
	"Tim Sell" <timothy.sell@unisys.com>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
	"Zaibo Xu" <xuzaibo@huawei.com>,
	"zhangfei.gao@foxmail.com" <zhangfei.gao@foxmail.com>,
	"linuxarm@huawei.com" <linuxarm@huawei.com>,
	"haojian.zhuang@linaro.org" <haojian.zhuang@linaro.org>,
	"Christoph Lameter" <cl@linux.com>,
	"Hao Fang" <fanghao11@huawei.com>,
	"Gavin Schenk" <g.schenk@eckelmann.de>,
	"RDMA mailing list" <linux-rdma@vger.kernel.org>,
	"Zhou Wang" <wangzhou1@hisilicon.com>,
	"Doug Ledford" <dledford@redhat.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"David Kershner" <david.kershner@unisys.com>,
	"Johan Hovold" <johan@kernel.org>,
	"Cyrille Pitchen" <cyrille.pitchen@free-electrons.com>,
	"Sagar Dharia" <sdharia@codeaurora.org>,
	"Jens Axboe" <axboe@kernel.dk>,
	"guodong.xu@linaro.org" <guodong.xu@linaro.org>,
	linux-netdev <netdev@vger.kernel.org>,
	"Randy Dunlap" <rdunlap@infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Vinod Koul" <vkoul@kernel.org>,
	"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
	"Philippe Ombredanne" <pombredanne@nexb.com>,
	"Sanyog Kale" <sanyog.r.kale@intel.com>,
	"David S. Miller" <davem@davemloft.net>,
	"linux-accelerators@lists.ozlabs.org"
	<linux-accelerators@lists.ozlabs.org>,
	"iommu@lists.linux-foundation.org"
	<iommu@lists.linux-foundation.org>
Subject: Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce
Date: Tue, 20 Nov 2018 12:19:07 +0000	[thread overview]
Message-ID: <8872e7d1-2cfd-36a8-d0a7-131cd8516ba3@arm.com> (raw)
In-Reply-To: <20181120091650.0000419a@huawei.com>

On 20/11/2018 09:16, Jonathan Cameron wrote:
> +CC Jean-Phillipe and iommu list.

Thanks for the Cc, sorry I don't have enough bandwidth to follow this
thread at the moment.

>>>>> In WarpDrive/uacce, we make this simple. If you support IOMMU and it support
>>>>> SVM/SVA. Everything will be fine just like ODP implicit mode. And you don't need
>>>>> to write any code for that. Because it has been done by IOMMU framework. If it  
>>>>
>>>> Looks like the IOMMU code uses mmu_notifier, so it is identical to
>>>> IB's ODP. The only difference is that IB tends to have the IOMMU page
>>>> table in the device, not in the CPU.
>>>>
>>>> The only case I know if that is different is the new-fangled CAPI
>>>> stuff where the IOMMU can directly use the CPU's page table and the
>>>> IOMMU page table (in device or CPU) is eliminated.  
>>>
>>> Yes. We are not focusing on the current implementation. As mentioned in the
>>> cover letter. We are expecting Jean Philips' SVA patch:
>>> git://linux-arm.org/linux-jpb.  
>>
>> This SVA stuff does not look comparable to CAPI as it still requires
>> maintaining seperate IOMMU page tables.

With SVA, we use the same page tables in the IOMMU and CPU. It's the
same pgd pointer, there is no mirroring of mappings. We bind the process
page tables with the device using a PASID (Process Address Space ID).

After fork(), the child's mm is different from the parent's one, and is
not automatically bound to the device. The device driver will have to
issue a new bind() request, and the child mm will be bound with a
different PASID.

There could be a problem if the child inherits the parent's device
handle. Then depending on the device, the child could be able to program
DMA and possibly access the parent's address space. The parent needs to
be aware of that when using the bind() API, and close the device fd in
the child after fork().

We use MMU notifiers for some address space changes:

* The IOTLB needs to be invalidated after any unmap() to the process
address space. On Arm systems the SMMU IOTLBs can be invalidated by the
CPU TLBI instructions, but we still need to invalidate TLBs private to
devices that are arch-agnostic (Address Translation Cache in PCI ATS).

* When the process mm exits, we need to remove the associated PASID
configuration in the IOMMU and invalidate the TLBs.

Thanks,
Jean

  reply	other threads:[~2018-11-20 12:20 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-12  7:58 [RFCv3 PATCH 0/6] A General Accelerator Framework, WarpDrive Kenneth Lee
2018-11-12  7:58 ` [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce Kenneth Lee
2018-11-13  0:23   ` Leon Romanovsky
2018-11-14  2:58     ` Kenneth Lee
2018-11-14 16:00       ` Leon Romanovsky
2018-11-15  8:51         ` Kenneth Lee
2018-11-15 14:54           ` Leon Romanovsky
2018-11-19  9:14             ` Kenneth Lee
2018-11-19  9:19               ` Kenneth Lee
2018-11-19 10:48                 ` Leon Romanovsky
2018-11-19 16:48                   ` Jerome Glisse
2018-11-19 18:27                     ` Jason Gunthorpe
2018-11-19 18:42                       ` Jerome Glisse
2018-11-19 18:53                         ` Jason Gunthorpe
2018-11-19 19:17                           ` Jerome Glisse
2018-11-19 19:27                             ` Jason Gunthorpe
2018-11-19 19:46                               ` Jerome Glisse
2018-11-19 20:11                                 ` Jason Gunthorpe
2018-11-19 20:26                                   ` Jerome Glisse
2018-11-19 21:26                                     ` Jason Gunthorpe
2018-11-19 21:33                                       ` Jerome Glisse
2018-11-19 21:41                                         ` Jason Gunthorpe
2018-11-19 19:02                         ` Leon Romanovsky
2018-11-19 19:19                         ` Christopher Lameter
2018-11-19 19:25                           ` Jerome Glisse
2018-11-20  2:30                   ` Kenneth Lee
2018-11-27  2:52                     ` Kenneth Lee
2018-11-19 18:49               ` Jason Gunthorpe
2018-11-20  3:07                 ` Kenneth Lee
2018-11-20  3:29                   ` Jason Gunthorpe
2018-11-20  9:16                     ` Jonathan Cameron
2018-11-20 12:19                       ` Jean-Philippe Brucker [this message]
2018-11-21  6:08                     ` Kenneth Lee
2018-11-22  2:58                       ` Jason Gunthorpe
2018-11-23  8:02                         ` Kenneth Lee
2018-11-23 18:05                           ` Jason Gunthorpe
2018-11-24  4:13                             ` Kenneth Lee
2018-11-20  5:17                   ` Leon Romanovsky
2018-11-21  3:02                     ` Kenneth Lee
2018-11-12  7:58 ` [RFCv3 PATCH 2/6] uacce: add uacce module Kenneth Lee
2018-11-12  7:58 ` [RFCv3 PATCH 3/6] crypto/hisilicon: add hisilicon Queue Manager driver Kenneth Lee
2018-11-12  7:58 ` [RFCv3 PATCH 4/6] crypto/hisilicon: add Hisilicon zip driver Kenneth Lee
2018-11-12  7:58 ` [RFCv3 PATCH 5/6] crypto: add uacce support to Hisilicon qm Kenneth Lee
2018-11-12  7:58 ` [RFCv3 PATCH 6/6] uacce: add user sample for uacce/warpdrive Kenneth Lee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8872e7d1-2cfd-36a8-d0a7-131cd8516ba3@arm.com \
    --to=jean-philippe.brucker@arm.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=axboe@kernel.dk \
    --cc=cl@linux.com \
    --cc=cyrille.pitchen@free-electrons.com \
    --cc=davem@davemloft.net \
    --cc=david.kershner@unisys.com \
    --cc=dledford@redhat.com \
    --cc=fanghao11@huawei.com \
    --cc=g.schenk@eckelmann.de \
    --cc=guodong.xu@linaro.org \
    --cc=haojian.zhuang@linaro.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jgg@ziepe.ca \
    --cc=johan@kernel.org \
    --cc=jonathan.cameron@huawei.com \
    --cc=leon@kernel.org \
    --cc=liguozhu@hisilicon.com \
    --cc=linux-accelerators@lists.ozlabs.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=nek.in.cn@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pombredanne@nexb.com \
    --cc=rdunlap@infradead.org \
    --cc=sanyog.r.kale@intel.com \
    --cc=sdharia@codeaurora.org \
    --cc=timothy.sell@unisys.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=vkoul@kernel.org \
    --cc=wangzhou1@hisilicon.com \
    --cc=xuzaibo@huawei.com \
    --cc=zhangfei.gao@foxmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).