[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8872e7d1-2cfd-36a8-d0a7-131cd8516ba3@arm.com>
Date: Tue, 20 Nov 2018 12:19:07 +0000
From: Jean-Philippe Brucker <jean-philippe.brucker@....com>
To: Jonathan Cameron <jonathan.cameron@...wei.com>,
Jason Gunthorpe <jgg@...pe.ca>
Cc: "liguozhu@...ilicon.com" <liguozhu@...ilicon.com>,
Leon Romanovsky <leon@...nel.org>,
Kenneth Lee <nek.in.cn@...il.com>,
Tim Sell <timothy.sell@...sys.com>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Zaibo Xu <xuzaibo@...wei.com>,
"zhangfei.gao@...mail.com" <zhangfei.gao@...mail.com>,
"linuxarm@...wei.com" <linuxarm@...wei.com>,
"haojian.zhuang@...aro.org" <haojian.zhuang@...aro.org>,
Christoph Lameter <cl@...ux.com>,
Hao Fang <fanghao11@...wei.com>,
Gavin Schenk <g.schenk@...elmann.de>,
RDMA mailing list <linux-rdma@...r.kernel.org>,
Zhou Wang <wangzhou1@...ilicon.com>,
Doug Ledford <dledford@...hat.com>,
Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
David Kershner <david.kershner@...sys.com>,
Johan Hovold <johan@...nel.org>,
Cyrille Pitchen <cyrille.pitchen@...e-electrons.com>,
Sagar Dharia <sdharia@...eaurora.org>,
Jens Axboe <axboe@...nel.dk>,
"guodong.xu@...aro.org" <guodong.xu@...aro.org>,
linux-netdev <netdev@...r.kernel.org>,
Randy Dunlap <rdunlap@...radead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Vinod Koul <vkoul@...nel.org>,
"linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>,
Philippe Ombredanne <pombredanne@...b.com>,
Sanyog Kale <sanyog.r.kale@...el.com>,
"David S. Miller" <davem@...emloft.net>,
"linux-accelerators@...ts.ozlabs.org"
<linux-accelerators@...ts.ozlabs.org>,
"iommu@...ts.linux-foundation.org" <iommu@...ts.linux-foundation.org>
Subject: Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce
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
Powered by blists - more mailing lists