All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacob Pan <jacob.jun.pan-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: "Christian König" <christian.koenig-5C7GfCeVMHo@public.gmane.org>
Cc: "xieyisheng1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org"
	<xieyisheng1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>,
	"ilias.apalodimas-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org"
	<ilias.apalodimas-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Will Deacon <Will.Deacon-5wv7dgnIgG8@public.gmane.org>,
	Michal Hocko <mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"okaya-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org"
	<okaya-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	"linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org"
	<linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org>,
	"ashok.raj-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org"
	<ashok.raj-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Jean-Philippe Brucker
	<jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>,
	"linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"rfranz-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org"
	<rfranz-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"kevin.tian-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org"
	<kevin.tian-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"rgummal-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org"
	<rgummal-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	"dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org"
	<dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	"liubo95-hv44wF8Li93QT0dZR+AlfA@public.gmane.org" <liubo95@hua>
Subject: Re: [PATCH v2 01/40] iommu: Introduce Shared Virtual Addressing API
Date: Fri, 7 Sep 2018 14:25:04 -0700	[thread overview]
Message-ID: <20180907142504.5034351e@jacob-builder> (raw)
In-Reply-To: <5bbc0332-b94b-75cc-ca42-a9b196811daf-5C7GfCeVMHo@public.gmane.org>

On Fri, 7 Sep 2018 20:02:54 +0200
Christian König <christian.koenig@amd.com> wrote:

> Am 07.09.2018 um 17:45 schrieb Jean-Philippe Brucker:
> > On 07/09/2018 09:55, Christian König wrote:  
> >> I will take this as an opportunity to summarize some of the
> >> requirements we have for PASID management from the amdgpu driver
> >> point of view:  
> > That's incredibly useful, thanks :)
> >  
> >> 1. We need to be able to allocate PASID between 1 and some
> >> maximum. Zero is reserved as far as I know, but we don't necessary
> >> need a minimum.  
>  [...]  
> >> 2. We need to be able to allocate PASIDs without a process address
> >> space backing it. E.g. our hardware uses PASIDs even without
> >> Shared Virtual Addressing enabled to distinct clients from each
> >> other. Would be a pity if we need to still have a separate PASID
> >> handling because the system wide is only available when IOMMU is
> >> turned on.  
>  [...]  
> 
> I agree on that.
> 
> > iommu-sva expects everywhere that the device has an iommu_domain,
> > it's the first thing we check on entry. Bypassing all of this would
> > call idr_alloc() directly, and wouldn't have any code in common
> > with the current iommu-sva. So it seems like you need a layer on
> > top of iommu-sva calling idr_alloc() when an IOMMU isn't present,
> > but I don't think it should be in drivers/iommu/  
> 
> In this case I question if the PASID handling should be under 
> drivers/iommu at all.
> 
> See I can have a mix of VM context which are bound to processes (some 
> few) and VM contexts which are standalone and doesn't care for a
> process address space. But for each VM context I need a distinct
> PASID for the hardware to work.
> 
> I can live if we say if IOMMU is completely disabled we use a simple
> ida to allocate them, but when IOMMU is enabled I certainly need a
> way to reserve a PASID without an associated process.
> 
VT-d would also have such requirement. There is a virtual command
register for allocate and free PASID for VM use. When that PASID
allocation request gets propagated to the host IOMMU driver, we need to
allocate PASID w/o mm.

If the PASID allocation is done via VFIO, can we have FD to track PASID
life cycle instead of mm_exit()? i.e. all FDs get closed before
mm_exit, I assume?

> >> 3. Even after destruction of a process address space we need some
> >> grace period before a PASID is reused because it can be that the
> >> specific PASID is still in some hardware queues etc...
> >>           At bare minimum all device drivers using process binding
> >> need to explicitly note to the core when they are done with a
> >> PASID.  
> > Right, much of the horribleness in iommu-sva deals with this:
> >
> > The process dies, iommu-sva is notified and calls the mm_exit()
> > function passed by the device driver to iommu_sva_device_init(). In
> > mm_exit() the device driver needs to clear any reference to the
> > PASID in hardware and in its own structures. When the device driver
> > returns from mm_exit(), it effectively tells the core that it has
> > finished using the PASID, and iommu-sva can reuse the PASID for
> > another process. mm_exit() is allowed to block, so the device
> > driver has time to clean up and flush the queues.
> >
> > If the device driver finishes using the PASID before the process
> > exits, it just calls unbind().  
> 
> Exactly that's what Michal Hocko is probably going to not like at all.
> 
> Can we have a different approach where each driver is informed by the 
> mm_exit(), but needs to explicitly call unbind() before a PASID is
> reused?
> 
> During that teardown transition it would be ideal if that PASID only 
> points to a dummy root page directory with only invalid entries.
> 
I guess this can be vendor specific, In VT-d I plan to mark PASID
entry not present and disable fault reporting while draining remaining
activities.

> >  
> >> 4. It would be nice to have to be able to set a "void *" for each
> >> PASID/device combination while binding to a process which then can
> >> be queried later on based on the PASID.
> >>           E.g. when you have a per PASID/device structure around
> >> anyway, just add an extra field.  
> > iommu_sva_bind_device() takes a "drvdata" pointer that is stored
> > internally for the PASID/device combination (iommu_bond). It is
> > passed to mm_exit(), but I haven't added anything for the device
> > driver to query it back.  
> 
> Nice! Looks like all we need additionally is a function to retrieve
> that based on the PASID.
> 
> >> 5. It would be nice to have to allocate multiple PASIDs for the
> >> same process address space.
> >>           E.g. some teams at AMD want to use a separate GPU
> >> address space for their userspace client library. I'm still trying
> >> to avoid that, but it is perfectly possible that we are going to
> >> need that.  
> > Two PASIDs pointing to the same process pgd? At first glance it
> > seems feasible, maybe with a flag passed to bind() and a few
> > changes to internal structures. It will duplicate ATC invalidation
> > commands for each process address space change (munmap etc) so you
> > might take a performance hit.
> >
> > Intel's SVM code has the SVM_FLAG_PRIVATE_PASID which seems similar
> > to what you describe, but I don't plan to support it in this series
> > (the io_mm model is already pretty complicated). I think it can be
> > added without too much effort in a future series, though with a
> > different flag name since we'd like to use "private PASID" for
> > something else
> > (https://www.spinics.net/lists/dri-devel/msg177007.html).  
> 
> To be honest I hoped that you would say: No never! So that I have a
> good argument to pushback on such requirements :)
> 
> But if it's doable it would be at least nice to have for debugging.
> 
> Thanks a lot for working on that,
> Christian.
> 
> >
> > Thanks,
> > Jean
> >  
> >>           Additional to that it is sometimes quite useful for
> >> debugging to isolate where exactly an incorrect access (segfault)
> >> is coming from.
> >>
> >> Let me know if there are some problems with that, especially I
> >> want to know if there is pushback on #5 so that I can forward
> >> that :)
> >>
> >> Thanks,
> >> Christian.
> >>  
> >>> Thanks,
> >>> Jean  
> 

[Jacob Pan]
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

WARNING: multiple messages have this Message-ID (diff)
From: Jacob Pan <jacob.jun.pan@linux.intel.com>
To: "Christian König" <christian.koenig@amd.com>
Cc: "xieyisheng1@huawei.com" <xieyisheng1@huawei.com>,
	"ilias.apalodimas@linaro.org" <ilias.apalodimas@linaro.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"xuzaibo@huawei.com" <xuzaibo@huawei.com>,
	"jonathan.cameron@huawei.com" <jonathan.cameron@huawei.com>,
	Will Deacon <Will.Deacon@arm.com>,
	Michal Hocko <mhocko@kernel.org>,
	"okaya@codeaurora.org" <okaya@codeaurora.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"yi.l.liu@intel.com" <yi.l.liu@intel.com>,
	"ashok.raj@intel.com" <ashok.raj@intel.com>,
	Jean-Philippe Brucker <jean-philippe.brucker@arm.com>,
	"tn@semihalf.com" <tn@semihalf.com>,
	"joro@8bytes.org" <joro@8bytes.org>,
	"robdclark@gmail.com" <robdclark@gmail.com>,
	"bharatku@xilinx.com" <bharatku@xilinx.com>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"liudongdong3@huawei.com" <liudongdong3@huawei.com>,
	"rfranz@cavium.com" <rfranz@cavium.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"kevin.tian@intel.com" <kevin.tian@intel.com>,
	jacob.jun.pan@linux.intel.com, Auger Eric <eric.auger@redhat.com>,
	"jcrouse@codeaurora.org" <jcrouse@codeaurora.org>,
	"rgummal@xilinx.com" <rgummal@xilinx.com>,
	"thunder.leizhen@huawei.com" <thunder.leizhen@huawei.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"shunyong.yang@hxt-semitech.com" <shunyong.yang@hxt-semitech.com>,
	"dwmw2@infradead.org" <dwmw2@infradead.org>,
	"liubo95@huawei.com" <liubo95@huawei.com>,
	"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
	"iommu@lists.linux-foundation.org"
	<iommu@lists.linux-foundation.org>,
	Robin Murphy <Robin.Murphy@arm.com>,
	"nwatters@codeaurora.org" <nwatters@codeaurora.org>,
	"baolu.lu@linux.intel.com" <baolu.lu@linux.intel.com>
Subject: Re: [PATCH v2 01/40] iommu: Introduce Shared Virtual Addressing API
Date: Fri, 7 Sep 2018 14:25:04 -0700	[thread overview]
Message-ID: <20180907142504.5034351e@jacob-builder> (raw)
In-Reply-To: <5bbc0332-b94b-75cc-ca42-a9b196811daf@amd.com>

T24gRnJpLCA3IFNlcCAyMDE4IDIwOjAyOjU0ICswMjAwCkNocmlzdGlhbiBLw7ZuaWcgPGNocmlz
dGlhbi5rb2VuaWdAYW1kLmNvbT4gd3JvdGU6Cgo+IEFtIDA3LjA5LjIwMTggdW0gMTc6NDUgc2No
cmllYiBKZWFuLVBoaWxpcHBlIEJydWNrZXI6Cj4gPiBPbiAwNy8wOS8yMDE4IDA5OjU1LCBDaHJp
c3RpYW4gS8O2bmlnIHdyb3RlOiAgCj4gPj4gSSB3aWxsIHRha2UgdGhpcyBhcyBhbiBvcHBvcnR1
bml0eSB0byBzdW1tYXJpemUgc29tZSBvZiB0aGUKPiA+PiByZXF1aXJlbWVudHMgd2UgaGF2ZSBm
b3IgUEFTSUQgbWFuYWdlbWVudCBmcm9tIHRoZSBhbWRncHUgZHJpdmVyCj4gPj4gcG9pbnQgb2Yg
dmlldzogIAo+ID4gVGhhdCdzIGluY3JlZGlibHkgdXNlZnVsLCB0aGFua3MgOikKPiA+ICAKPiA+
PiAxLiBXZSBuZWVkIHRvIGJlIGFibGUgdG8gYWxsb2NhdGUgUEFTSUQgYmV0d2VlbiAxIGFuZCBz
b21lCj4gPj4gbWF4aW11bS4gWmVybyBpcyByZXNlcnZlZCBhcyBmYXIgYXMgSSBrbm93LCBidXQg
d2UgZG9uJ3QgbmVjZXNzYXJ5Cj4gPj4gbmVlZCBhIG1pbmltdW0uICAKPiAgWy4uLl0gIAo+ID4+
IDIuIFdlIG5lZWQgdG8gYmUgYWJsZSB0byBhbGxvY2F0ZSBQQVNJRHMgd2l0aG91dCBhIHByb2Nl
c3MgYWRkcmVzc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ZhdWx0KQo+ID4+IGlzIGNvbWluZyBmcm9tLgo+ID4+Cj4gPj4gTGV0IG1lIGtub3cgaWYg
dGhlcmUgYXJlIHNvbWUgcHJvYmxlbXMgd2l0aCB0aGF0LCBlc3BlY2lhbGx5IEkKPiA+PiB3YW50
IHRvIGtub3cgaWYgdGhlcmUgaXMgcHVzaGJhY2sgb24gIzUgc28gdGhhdCBJIGNhbiBmb3J3YXJk
Cj4gPj4gdGhhdCA6KQo+ID4+Cj4gPj4gVGhhbmtzLAo+ID4+IENocmlzdGlhbi4KPiA+PiAgCj4g
Pj4+IFRoYW5rcywKPiA+Pj4gSmVhbiAgCj4gCgpbSmFjb2IgUGFuXQoKX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGludXgtYXJtLWtlcm5lbCBtYWlsaW5n
IGxpc3QKbGludXgtYXJtLWtlcm5lbEBsaXN0cy5pbmZyYWRlYWQub3JnCmh0dHA6Ly9saXN0cy5p
bmZyYWRlYWQub3JnL21haWxtYW4vbGlzdGluZm8vbGludXgtYXJtLWtlcm5lbAo=

WARNING: multiple messages have this Message-ID (diff)
From: Jacob Pan <jacob.jun.pan-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: "Christian König" <christian.koenig-5C7GfCeVMHo@public.gmane.org>
Cc: "xieyisheng1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org"
	<xieyisheng1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>,
	"ilias.apalodimas-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org"
	<ilias.apalodimas-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Will Deacon <Will.Deacon-5wv7dgnIgG8@public.gmane.org>,
	Michal Hocko <mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"okaya-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org"
	<okaya-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	"linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org"
	<linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org>,
	"ashok.raj-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org"
	<ashok.raj-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Jean-Philippe Brucker
	<jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>,
	"linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"rfranz-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org"
	<rfranz-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"kevin.tian-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org"
	<kevin.tian-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"rgummal-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org"
	<rgummal-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	"dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org"
	<dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	"liubo95-hv44wF8Li93QT0dZR+AlfA@public.gmane.org" <liubo95@hua
Subject: Re: [PATCH v2 01/40] iommu: Introduce Shared Virtual Addressing API
Date: Fri, 7 Sep 2018 14:25:04 -0700	[thread overview]
Message-ID: <20180907142504.5034351e@jacob-builder> (raw)
In-Reply-To: <5bbc0332-b94b-75cc-ca42-a9b196811daf-5C7GfCeVMHo@public.gmane.org>

On Fri, 7 Sep 2018 20:02:54 +0200
Christian König <christian.koenig@amd.com> wrote:

> Am 07.09.2018 um 17:45 schrieb Jean-Philippe Brucker:
> > On 07/09/2018 09:55, Christian König wrote:  
> >> I will take this as an opportunity to summarize some of the
> >> requirements we have for PASID management from the amdgpu driver
> >> point of view:  
> > That's incredibly useful, thanks :)
> >  
> >> 1. We need to be able to allocate PASID between 1 and some
> >> maximum. Zero is reserved as far as I know, but we don't necessary
> >> need a minimum.  
>  [...]  
> >> 2. We need to be able to allocate PASIDs without a process address
> >> space backing it. E.g. our hardware uses PASIDs even without
> >> Shared Virtual Addressing enabled to distinct clients from each
> >> other. Would be a pity if we need to still have a separate PASID
> >> handling because the system wide is only available when IOMMU is
> >> turned on.  
>  [...]  
> 
> I agree on that.
> 
> > iommu-sva expects everywhere that the device has an iommu_domain,
> > it's the first thing we check on entry. Bypassing all of this would
> > call idr_alloc() directly, and wouldn't have any code in common
> > with the current iommu-sva. So it seems like you need a layer on
> > top of iommu-sva calling idr_alloc() when an IOMMU isn't present,
> > but I don't think it should be in drivers/iommu/  
> 
> In this case I question if the PASID handling should be under 
> drivers/iommu at all.
> 
> See I can have a mix of VM context which are bound to processes (some 
> few) and VM contexts which are standalone and doesn't care for a
> process address space. But for each VM context I need a distinct
> PASID for the hardware to work.
> 
> I can live if we say if IOMMU is completely disabled we use a simple
> ida to allocate them, but when IOMMU is enabled I certainly need a
> way to reserve a PASID without an associated process.
> 
VT-d would also have such requirement. There is a virtual command
register for allocate and free PASID for VM use. When that PASID
allocation request gets propagated to the host IOMMU driver, we need to
allocate PASID w/o mm.

If the PASID allocation is done via VFIO, can we have FD to track PASID
life cycle instead of mm_exit()? i.e. all FDs get closed before
mm_exit, I assume?

> >> 3. Even after destruction of a process address space we need some
> >> grace period before a PASID is reused because it can be that the
> >> specific PASID is still in some hardware queues etc...
> >>           At bare minimum all device drivers using process binding
> >> need to explicitly note to the core when they are done with a
> >> PASID.  
> > Right, much of the horribleness in iommu-sva deals with this:
> >
> > The process dies, iommu-sva is notified and calls the mm_exit()
> > function passed by the device driver to iommu_sva_device_init(). In
> > mm_exit() the device driver needs to clear any reference to the
> > PASID in hardware and in its own structures. When the device driver
> > returns from mm_exit(), it effectively tells the core that it has
> > finished using the PASID, and iommu-sva can reuse the PASID for
> > another process. mm_exit() is allowed to block, so the device
> > driver has time to clean up and flush the queues.
> >
> > If the device driver finishes using the PASID before the process
> > exits, it just calls unbind().  
> 
> Exactly that's what Michal Hocko is probably going to not like at all.
> 
> Can we have a different approach where each driver is informed by the 
> mm_exit(), but needs to explicitly call unbind() before a PASID is
> reused?
> 
> During that teardown transition it would be ideal if that PASID only 
> points to a dummy root page directory with only invalid entries.
> 
I guess this can be vendor specific, In VT-d I plan to mark PASID
entry not present and disable fault reporting while draining remaining
activities.

> >  
> >> 4. It would be nice to have to be able to set a "void *" for each
> >> PASID/device combination while binding to a process which then can
> >> be queried later on based on the PASID.
> >>           E.g. when you have a per PASID/device structure around
> >> anyway, just add an extra field.  
> > iommu_sva_bind_device() takes a "drvdata" pointer that is stored
> > internally for the PASID/device combination (iommu_bond). It is
> > passed to mm_exit(), but I haven't added anything for the device
> > driver to query it back.  
> 
> Nice! Looks like all we need additionally is a function to retrieve
> that based on the PASID.
> 
> >> 5. It would be nice to have to allocate multiple PASIDs for the
> >> same process address space.
> >>           E.g. some teams at AMD want to use a separate GPU
> >> address space for their userspace client library. I'm still trying
> >> to avoid that, but it is perfectly possible that we are going to
> >> need that.  
> > Two PASIDs pointing to the same process pgd? At first glance it
> > seems feasible, maybe with a flag passed to bind() and a few
> > changes to internal structures. It will duplicate ATC invalidation
> > commands for each process address space change (munmap etc) so you
> > might take a performance hit.
> >
> > Intel's SVM code has the SVM_FLAG_PRIVATE_PASID which seems similar
> > to what you describe, but I don't plan to support it in this series
> > (the io_mm model is already pretty complicated). I think it can be
> > added without too much effort in a future series, though with a
> > different flag name since we'd like to use "private PASID" for
> > something else
> > (https://www.spinics.net/lists/dri-devel/msg177007.html).  
> 
> To be honest I hoped that you would say: No never! So that I have a
> good argument to pushback on such requirements :)
> 
> But if it's doable it would be at least nice to have for debugging.
> 
> Thanks a lot for working on that,
> Christian.
> 
> >
> > Thanks,
> > Jean
> >  
> >>           Additional to that it is sometimes quite useful for
> >> debugging to isolate where exactly an incorrect access (segfault)
> >> is coming from.
> >>
> >> Let me know if there are some problems with that, especially I
> >> want to know if there is pushback on #5 so that I can forward
> >> that :)
> >>
> >> Thanks,
> >> Christian.
> >>  
> >>> Thanks,
> >>> Jean  
> 

[Jacob Pan]
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

WARNING: multiple messages have this Message-ID (diff)
From: Jacob Pan <jacob.jun.pan@linux.intel.com>
To: "Christian König" <christian.koenig@amd.com>
Cc: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>,
	Auger Eric <eric.auger@redhat.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"iommu@lists.linux-foundation.org"
	<iommu@lists.linux-foundation.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"xieyisheng1@huawei.com" <xieyisheng1@huawei.com>,
	"liubo95@huawei.com" <liubo95@huawei.com>,
	"xuzaibo@huawei.com" <xuzaibo@huawei.com>,
	"thunder.leizhen@huawei.com" <thunder.leizhen@huawei.com>,
	Will Deacon <Will.Deacon@arm.com>,
	"okaya@codeaurora.org" <okaya@codeaurora.org>,
	"yi.l.liu@intel.com" <yi.l.liu@intel.com>,
	"ashok.raj@intel.com" <ashok.raj@intel.com>,
	"tn@semihalf.com" <tn@semihalf.com>,
	"joro@8bytes.org" <joro@8bytes.org>,
	"bharatku@xilinx.com" <bharatku@xilinx.com>,
	"liudongdong3@huawei.com" <liudongdong3@huawei.com>,
	"rfranz@cavium.com" <rfranz@cavium.com>,
	"kevin.tian@intel.com" <kevin.tian@intel.com>,
	"jcrouse@codeaurora.org" <jcrouse@codeaurora.org>,
	"rgummal@xilinx.com" <rgummal@xilinx.com>,
	"jonathan.cameron@huawei.com" <jonathan.cameron@huawei.com>,
	"shunyong.yang@hxt-semitech.com" <shunyong.yang@hxt-semitech.com>,
	Robin Murphy <Robin.Murphy@arm.com>,
	"ilias.apalodimas@linaro.org" <ilias.apalodimas@linaro.org>,
	"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
	"robdclark@gmail.com" <robdclark@gmail.com>,
	"dwmw2@infradead.org" <dwmw2@infradead.org>,
	"nwatters@codeaurora.org" <nwatters@codeaurora.org>,
	"baolu.lu@linux.intel.com" <baolu.lu@linux.intel.com>,
	Michal Hocko <mhocko@kernel.org>,
	jacob.jun.pan@linux.intel.com
Subject: Re: [PATCH v2 01/40] iommu: Introduce Shared Virtual Addressing API
Date: Fri, 7 Sep 2018 14:25:04 -0700	[thread overview]
Message-ID: <20180907142504.5034351e@jacob-builder> (raw)
In-Reply-To: <5bbc0332-b94b-75cc-ca42-a9b196811daf@amd.com>

On Fri, 7 Sep 2018 20:02:54 +0200
Christian König <christian.koenig@amd.com> wrote:

> Am 07.09.2018 um 17:45 schrieb Jean-Philippe Brucker:
> > On 07/09/2018 09:55, Christian König wrote:  
> >> I will take this as an opportunity to summarize some of the
> >> requirements we have for PASID management from the amdgpu driver
> >> point of view:  
> > That's incredibly useful, thanks :)
> >  
> >> 1. We need to be able to allocate PASID between 1 and some
> >> maximum. Zero is reserved as far as I know, but we don't necessary
> >> need a minimum.  
>  [...]  
> >> 2. We need to be able to allocate PASIDs without a process address
> >> space backing it. E.g. our hardware uses PASIDs even without
> >> Shared Virtual Addressing enabled to distinct clients from each
> >> other. Would be a pity if we need to still have a separate PASID
> >> handling because the system wide is only available when IOMMU is
> >> turned on.  
>  [...]  
> 
> I agree on that.
> 
> > iommu-sva expects everywhere that the device has an iommu_domain,
> > it's the first thing we check on entry. Bypassing all of this would
> > call idr_alloc() directly, and wouldn't have any code in common
> > with the current iommu-sva. So it seems like you need a layer on
> > top of iommu-sva calling idr_alloc() when an IOMMU isn't present,
> > but I don't think it should be in drivers/iommu/  
> 
> In this case I question if the PASID handling should be under 
> drivers/iommu at all.
> 
> See I can have a mix of VM context which are bound to processes (some 
> few) and VM contexts which are standalone and doesn't care for a
> process address space. But for each VM context I need a distinct
> PASID for the hardware to work.
> 
> I can live if we say if IOMMU is completely disabled we use a simple
> ida to allocate them, but when IOMMU is enabled I certainly need a
> way to reserve a PASID without an associated process.
> 
VT-d would also have such requirement. There is a virtual command
register for allocate and free PASID for VM use. When that PASID
allocation request gets propagated to the host IOMMU driver, we need to
allocate PASID w/o mm.

If the PASID allocation is done via VFIO, can we have FD to track PASID
life cycle instead of mm_exit()? i.e. all FDs get closed before
mm_exit, I assume?

> >> 3. Even after destruction of a process address space we need some
> >> grace period before a PASID is reused because it can be that the
> >> specific PASID is still in some hardware queues etc...
> >>           At bare minimum all device drivers using process binding
> >> need to explicitly note to the core when they are done with a
> >> PASID.  
> > Right, much of the horribleness in iommu-sva deals with this:
> >
> > The process dies, iommu-sva is notified and calls the mm_exit()
> > function passed by the device driver to iommu_sva_device_init(). In
> > mm_exit() the device driver needs to clear any reference to the
> > PASID in hardware and in its own structures. When the device driver
> > returns from mm_exit(), it effectively tells the core that it has
> > finished using the PASID, and iommu-sva can reuse the PASID for
> > another process. mm_exit() is allowed to block, so the device
> > driver has time to clean up and flush the queues.
> >
> > If the device driver finishes using the PASID before the process
> > exits, it just calls unbind().  
> 
> Exactly that's what Michal Hocko is probably going to not like at all.
> 
> Can we have a different approach where each driver is informed by the 
> mm_exit(), but needs to explicitly call unbind() before a PASID is
> reused?
> 
> During that teardown transition it would be ideal if that PASID only 
> points to a dummy root page directory with only invalid entries.
> 
I guess this can be vendor specific, In VT-d I plan to mark PASID
entry not present and disable fault reporting while draining remaining
activities.

> >  
> >> 4. It would be nice to have to be able to set a "void *" for each
> >> PASID/device combination while binding to a process which then can
> >> be queried later on based on the PASID.
> >>           E.g. when you have a per PASID/device structure around
> >> anyway, just add an extra field.  
> > iommu_sva_bind_device() takes a "drvdata" pointer that is stored
> > internally for the PASID/device combination (iommu_bond). It is
> > passed to mm_exit(), but I haven't added anything for the device
> > driver to query it back.  
> 
> Nice! Looks like all we need additionally is a function to retrieve
> that based on the PASID.
> 
> >> 5. It would be nice to have to allocate multiple PASIDs for the
> >> same process address space.
> >>           E.g. some teams at AMD want to use a separate GPU
> >> address space for their userspace client library. I'm still trying
> >> to avoid that, but it is perfectly possible that we are going to
> >> need that.  
> > Two PASIDs pointing to the same process pgd? At first glance it
> > seems feasible, maybe with a flag passed to bind() and a few
> > changes to internal structures. It will duplicate ATC invalidation
> > commands for each process address space change (munmap etc) so you
> > might take a performance hit.
> >
> > Intel's SVM code has the SVM_FLAG_PRIVATE_PASID which seems similar
> > to what you describe, but I don't plan to support it in this series
> > (the io_mm model is already pretty complicated). I think it can be
> > added without too much effort in a future series, though with a
> > different flag name since we'd like to use "private PASID" for
> > something else
> > (https://www.spinics.net/lists/dri-devel/msg177007.html).  
> 
> To be honest I hoped that you would say: No never! So that I have a
> good argument to pushback on such requirements :)
> 
> But if it's doable it would be at least nice to have for debugging.
> 
> Thanks a lot for working on that,
> Christian.
> 
> >
> > Thanks,
> > Jean
> >  
> >>           Additional to that it is sometimes quite useful for
> >> debugging to isolate where exactly an incorrect access (segfault)
> >> is coming from.
> >>
> >> Let me know if there are some problems with that, especially I
> >> want to know if there is pushback on #5 so that I can forward
> >> that :)
> >>
> >> Thanks,
> >> Christian.
> >>  
> >>> Thanks,
> >>> Jean  
> 

[Jacob Pan]

WARNING: multiple messages have this Message-ID (diff)
From: jacob.jun.pan@linux.intel.com (Jacob Pan)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 01/40] iommu: Introduce Shared Virtual Addressing API
Date: Fri, 7 Sep 2018 14:25:04 -0700	[thread overview]
Message-ID: <20180907142504.5034351e@jacob-builder> (raw)
In-Reply-To: <5bbc0332-b94b-75cc-ca42-a9b196811daf@amd.com>

On Fri, 7 Sep 2018 20:02:54 +0200
Christian K?nig <christian.koenig@amd.com> wrote:

> Am 07.09.2018 um 17:45 schrieb Jean-Philippe Brucker:
> > On 07/09/2018 09:55, Christian K?nig wrote:  
> >> I will take this as an opportunity to summarize some of the
> >> requirements we have for PASID management from the amdgpu driver
> >> point of view:  
> > That's incredibly useful, thanks :)
> >  
> >> 1. We need to be able to allocate PASID between 1 and some
> >> maximum. Zero is reserved as far as I know, but we don't necessary
> >> need a minimum.  
>  [...]  
> >> 2. We need to be able to allocate PASIDs without a process address
> >> space backing it. E.g. our hardware uses PASIDs even without
> >> Shared Virtual Addressing enabled to distinct clients from each
> >> other. Would be a pity if we need to still have a separate PASID
> >> handling because the system wide is only available when IOMMU is
> >> turned on.  
>  [...]  
> 
> I agree on that.
> 
> > iommu-sva expects everywhere that the device has an iommu_domain,
> > it's the first thing we check on entry. Bypassing all of this would
> > call idr_alloc() directly, and wouldn't have any code in common
> > with the current iommu-sva. So it seems like you need a layer on
> > top of iommu-sva calling idr_alloc() when an IOMMU isn't present,
> > but I don't think it should be in drivers/iommu/  
> 
> In this case I question if the PASID handling should be under 
> drivers/iommu at all.
> 
> See I can have a mix of VM context which are bound to processes (some 
> few) and VM contexts which are standalone and doesn't care for a
> process address space. But for each VM context I need a distinct
> PASID for the hardware to work.
> 
> I can live if we say if IOMMU is completely disabled we use a simple
> ida to allocate them, but when IOMMU is enabled I certainly need a
> way to reserve a PASID without an associated process.
> 
VT-d would also have such requirement. There is a virtual command
register for allocate and free PASID for VM use. When that PASID
allocation request gets propagated to the host IOMMU driver, we need to
allocate PASID w/o mm.

If the PASID allocation is done via VFIO, can we have FD to track PASID
life cycle instead of mm_exit()? i.e. all FDs get closed before
mm_exit, I assume?

> >> 3. Even after destruction of a process address space we need some
> >> grace period before a PASID is reused because it can be that the
> >> specific PASID is still in some hardware queues etc...
> >>   ??? ??? At bare minimum all device drivers using process binding
> >> need to explicitly note to the core when they are done with a
> >> PASID.  
> > Right, much of the horribleness in iommu-sva deals with this:
> >
> > The process dies, iommu-sva is notified and calls the mm_exit()
> > function passed by the device driver to iommu_sva_device_init(). In
> > mm_exit() the device driver needs to clear any reference to the
> > PASID in hardware and in its own structures. When the device driver
> > returns from mm_exit(), it effectively tells the core that it has
> > finished using the PASID, and iommu-sva can reuse the PASID for
> > another process. mm_exit() is allowed to block, so the device
> > driver has time to clean up and flush the queues.
> >
> > If the device driver finishes using the PASID before the process
> > exits, it just calls unbind().  
> 
> Exactly that's what Michal Hocko is probably going to not like at all.
> 
> Can we have a different approach where each driver is informed by the 
> mm_exit(), but needs to explicitly call unbind() before a PASID is
> reused?
> 
> During that teardown transition it would be ideal if that PASID only 
> points to a dummy root page directory with only invalid entries.
> 
I guess this can be vendor specific, In VT-d I plan to mark PASID
entry not present and disable fault reporting while draining remaining
activities.

> >  
> >> 4. It would be nice to have to be able to set a "void *" for each
> >> PASID/device combination while binding to a process which then can
> >> be queried later on based on the PASID.
> >>   ??? ??? E.g. when you have a per PASID/device structure around
> >> anyway, just add an extra field.  
> > iommu_sva_bind_device() takes a "drvdata" pointer that is stored
> > internally for the PASID/device combination (iommu_bond). It is
> > passed to mm_exit(), but I haven't added anything for the device
> > driver to query it back.  
> 
> Nice! Looks like all we need additionally is a function to retrieve
> that based on the PASID.
> 
> >> 5. It would be nice to have to allocate multiple PASIDs for the
> >> same process address space.
> >>   ??? ??? E.g. some teams at AMD want to use a separate GPU
> >> address space for their userspace client library. I'm still trying
> >> to avoid that, but it is perfectly possible that we are going to
> >> need that.  
> > Two PASIDs pointing to the same process pgd? At first glance it
> > seems feasible, maybe with a flag passed to bind() and a few
> > changes to internal structures. It will duplicate ATC invalidation
> > commands for each process address space change (munmap etc) so you
> > might take a performance hit.
> >
> > Intel's SVM code has the SVM_FLAG_PRIVATE_PASID which seems similar
> > to what you describe, but I don't plan to support it in this series
> > (the io_mm model is already pretty complicated). I think it can be
> > added without too much effort in a future series, though with a
> > different flag name since we'd like to use "private PASID" for
> > something else
> > (https://www.spinics.net/lists/dri-devel/msg177007.html).  
> 
> To be honest I hoped that you would say: No never! So that I have a
> good argument to pushback on such requirements :)
> 
> But if it's doable it would be at least nice to have for debugging.
> 
> Thanks a lot for working on that,
> Christian.
> 
> >
> > Thanks,
> > Jean
> >  
> >>   ??? ??? Additional to that it is sometimes quite useful for
> >> debugging to isolate where exactly an incorrect access (segfault)
> >> is coming from.
> >>
> >> Let me know if there are some problems with that, especially I
> >> want to know if there is pushback on #5 so that I can forward
> >> that :)
> >>
> >> Thanks,
> >> Christian.
> >>  
> >>> Thanks,
> >>> Jean  
> 

[Jacob Pan]

  parent reply	other threads:[~2018-09-07 21:25 UTC|newest]

Thread overview: 435+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-11 19:06 [PATCH v2 00/40] Shared Virtual Addressing for the IOMMU Jean-Philippe Brucker
2018-05-11 19:06 ` Jean-Philippe Brucker
2018-05-11 19:06 ` Jean-Philippe Brucker
     [not found] ` <20180511190641.23008-1-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2018-05-11 19:06   ` [PATCH v2 01/40] iommu: Introduce Shared Virtual Addressing API Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
     [not found]     ` <20180511190641.23008-2-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2018-05-16 20:41       ` Jacob Pan
2018-05-16 20:41         ` Jacob Pan
2018-05-16 20:41         ` Jacob Pan
2018-05-17 10:02         ` Jean-Philippe Brucker
2018-05-17 10:02           ` Jean-Philippe Brucker
2018-05-17 10:02           ` Jean-Philippe Brucker
2018-05-17 17:00           ` Jacob Pan
2018-05-17 17:00             ` Jacob Pan
2018-05-17 17:00             ` Jacob Pan
2018-05-17 17:00             ` Jacob Pan
2018-05-17 17:00             ` Jacob Pan
2018-09-05 11:29       ` Auger Eric
2018-09-05 11:29         ` Auger Eric
2018-09-05 11:29         ` Auger Eric
2018-09-05 11:29         ` Auger Eric
     [not found]         ` <bf42affd-e9d0-e4fc-6d28-f3c3f7795348-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-09-06 11:09           ` Jean-Philippe Brucker
2018-09-06 11:09             ` Jean-Philippe Brucker
2018-09-06 11:09             ` Jean-Philippe Brucker
2018-09-06 11:09             ` Jean-Philippe Brucker
     [not found]             ` <03d31ba5-1eda-ea86-8c0c-91d14c86fe83-5wv7dgnIgG8@public.gmane.org>
2018-09-06 11:12               ` Christian König
2018-09-06 11:12                 ` Christian König
2018-09-06 11:12                 ` Christian König
2018-09-06 11:12                 ` Christian König
     [not found]                 ` <ed39159c-087e-7e56-7d29-d1de9fa1677f-5C7GfCeVMHo@public.gmane.org>
2018-09-06 12:45                   ` Jean-Philippe Brucker
2018-09-06 12:45                     ` Jean-Philippe Brucker
2018-09-06 12:45                     ` Jean-Philippe Brucker
2018-09-06 12:45                     ` Jean-Philippe Brucker
     [not found]                     ` <f0b317d5-e2e9-5478-952c-05e8b97bd68b-5wv7dgnIgG8@public.gmane.org>
2018-09-07  8:55                       ` Christian König
2018-09-07  8:55                         ` Christian König
2018-09-07  8:55                         ` Christian König
2018-09-07  8:55                         ` Christian König
     [not found]                         ` <2fd4a0a1-1a35-bf82-df84-b995cce011d9-5C7GfCeVMHo@public.gmane.org>
2018-09-07 15:45                           ` Jean-Philippe Brucker
2018-09-07 15:45                             ` Jean-Philippe Brucker
2018-09-07 15:45                             ` Jean-Philippe Brucker
2018-09-07 15:45                             ` Jean-Philippe Brucker
     [not found]                             ` <65e7accd-4446-19f5-c667-c6407e89cfa6-5wv7dgnIgG8@public.gmane.org>
2018-09-07 18:02                               ` Christian König
2018-09-07 18:02                                 ` Christian König
2018-09-07 18:02                                 ` Christian König
2018-09-07 18:02                                 ` Christian König
     [not found]                                 ` <5bbc0332-b94b-75cc-ca42-a9b196811daf-5C7GfCeVMHo@public.gmane.org>
2018-09-07 21:25                                   ` Jacob Pan [this message]
2018-09-07 21:25                                     ` Jacob Pan
2018-09-07 21:25                                     ` Jacob Pan
2018-09-07 21:25                                     ` Jacob Pan
2018-09-07 21:25                                     ` Jacob Pan
2018-09-08  7:29                                     ` Christian König
2018-09-08  7:29                                       ` Christian König
2018-09-08  7:29                                       ` Christian König
2018-09-08  7:29                                       ` Christian König
2018-09-08  7:29                                       ` Christian König
     [not found]                                       ` <3e3a6797-a233-911b-3a7d-d9b549160960-5C7GfCeVMHo@public.gmane.org>
2018-09-12 12:40                                         ` Jean-Philippe Brucker
2018-09-12 12:40                                           ` Jean-Philippe Brucker
2018-09-12 12:40                                           ` Jean-Philippe Brucker
2018-09-12 12:40                                           ` Jean-Philippe Brucker
2018-09-12 12:40                                           ` Jean-Philippe Brucker
     [not found]                                           ` <9445a0be-fb5b-d195-4fdf-7ad6cb36ef4f-5wv7dgnIgG8@public.gmane.org>
2018-09-12 12:56                                             ` Christian König
2018-09-12 12:56                                               ` Christian König
2018-09-12 12:56                                               ` Christian König
2018-09-12 12:56                                               ` Christian König
2018-09-12 12:56                                               ` Christian König
2018-09-13  7:15                                     ` Tian, Kevin
2018-09-13  7:15                                       ` Tian, Kevin
2018-09-13  7:15                                       ` Tian, Kevin
2018-09-13  7:15                                       ` Tian, Kevin
2018-09-13  7:15                                       ` Tian, Kevin
2018-09-13  7:26                           ` Tian, Kevin
2018-09-13  7:26                             ` Tian, Kevin
2018-09-13  7:26                             ` Tian, Kevin
2018-09-13  7:26                             ` Tian, Kevin
2018-05-11 19:06   ` [PATCH v2 02/40] iommu/sva: Bind process address spaces to devices Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
     [not found]     ` <20180511190641.23008-3-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2018-05-17 13:10       ` Jonathan Cameron
2018-05-17 13:10         ` Jonathan Cameron
2018-05-17 13:10         ` Jonathan Cameron
2018-05-17 13:10         ` Jonathan Cameron
     [not found]         ` <20180517141058.00001c76-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-05-21 14:43           ` Jean-Philippe Brucker
2018-05-21 14:43             ` Jean-Philippe Brucker
2018-05-21 14:43             ` Jean-Philippe Brucker
2018-09-05 11:29       ` Auger Eric
2018-09-05 11:29         ` Auger Eric
2018-09-05 11:29         ` Auger Eric
     [not found]         ` <471873d4-a1a6-1a3a-cf17-1e686b4ade96-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-09-06 11:09           ` Jean-Philippe Brucker
2018-09-06 11:09             ` Jean-Philippe Brucker
2018-09-06 11:09             ` Jean-Philippe Brucker
2018-09-06 11:09             ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 03/40] iommu/sva: Manage process address spaces Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
     [not found]     ` <20180511190641.23008-4-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2018-05-16 23:31       ` Jacob Pan
2018-05-16 23:31         ` Jacob Pan
2018-05-16 23:31         ` Jacob Pan
2018-05-16 23:31         ` Jacob Pan
2018-05-17 10:02         ` Jean-Philippe Brucker
2018-05-17 10:02           ` Jean-Philippe Brucker
2018-05-17 10:02           ` Jean-Philippe Brucker
     [not found]           ` <de478769-9f7a-d40b-a55e-e2c63ad883e8-5wv7dgnIgG8@public.gmane.org>
2018-05-22 16:43             ` Jacob Pan
2018-05-22 16:43               ` Jacob Pan
2018-05-22 16:43               ` Jacob Pan
2018-05-22 16:43               ` Jacob Pan
2018-05-24 11:44               ` Jean-Philippe Brucker
2018-05-24 11:44                 ` Jean-Philippe Brucker
2018-05-24 11:44                 ` Jean-Philippe Brucker
2018-05-24 11:50                 ` Ilias Apalodimas
2018-05-24 11:50                   ` Ilias Apalodimas
2018-05-24 11:50                   ` Ilias Apalodimas
2018-05-24 11:50                   ` Ilias Apalodimas
2018-05-24 11:50                   ` Ilias Apalodimas
2018-05-24 15:04                   ` Jean-Philippe Brucker
2018-05-24 15:04                     ` Jean-Philippe Brucker
2018-05-24 15:04                     ` Jean-Philippe Brucker
2018-05-24 15:04                     ` Jean-Philippe Brucker
     [not found]                     ` <19e82a74-429a-3f86-119e-32b12082d0ff-5wv7dgnIgG8@public.gmane.org>
2018-05-25  6:33                       ` Ilias Apalodimas
2018-05-25  6:33                         ` Ilias Apalodimas
2018-05-25  6:33                         ` Ilias Apalodimas
2018-05-25  6:33                         ` Ilias Apalodimas
2018-05-25  8:39                         ` Jonathan Cameron
2018-05-25  8:39                           ` Jonathan Cameron
2018-05-25  8:39                           ` Jonathan Cameron
2018-05-25  8:39                           ` Jonathan Cameron
2018-05-26  2:24                           ` Kenneth Lee
2018-05-26  2:24                           ` Kenneth Lee
2018-05-26  2:24                           ` Kenneth Lee
     [not found]                           ` <20180525093959.000040a7-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-05-26  2:24                             ` Kenneth Lee
2018-05-26  2:24                           ` Kenneth Lee
2018-05-26  2:24                           ` Kenneth Lee
2018-06-11 16:10                             ` Kenneth Lee
2018-06-11 16:10                             ` Kenneth Lee
2018-06-11 16:10                             ` Kenneth Lee
2018-06-11 16:10                             ` Kenneth Lee
2018-06-11 16:10                             ` Kenneth Lee
2018-06-11 16:10                             ` Kenneth Lee
2018-06-11 16:32                           ` Kenneth Lee
2018-06-11 16:32                             ` Kenneth Lee
2018-06-11 16:32                             ` Kenneth Lee
2018-06-11 16:32                             ` Kenneth Lee
2018-06-11 16:32                             ` Kenneth Lee
2018-05-17 14:25       ` Jonathan Cameron
2018-05-17 14:25         ` Jonathan Cameron
2018-05-17 14:25         ` Jonathan Cameron
2018-05-17 14:25         ` Jonathan Cameron
     [not found]         ` <20180517150516.000067ca-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-05-21 14:44           ` Jean-Philippe Brucker
2018-05-21 14:44             ` Jean-Philippe Brucker
2018-05-21 14:44             ` Jean-Philippe Brucker
2018-09-05 12:14       ` Auger Eric
2018-09-05 12:14         ` Auger Eric
2018-09-05 12:14         ` Auger Eric
2018-09-05 12:14         ` Auger Eric
     [not found]         ` <d785ec89-6743-d0f1-1a7f-85599a033e5b-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-09-05 18:18           ` Jacob Pan
2018-09-05 18:18             ` Jacob Pan
2018-09-05 18:18             ` Jacob Pan
2018-09-06 17:40             ` Jean-Philippe Brucker
2018-09-06 17:40               ` Jean-Philippe Brucker
2018-09-06 17:40               ` Jean-Philippe Brucker
2018-09-06 17:40               ` Jean-Philippe Brucker
2018-09-06 17:40               ` Jean-Philippe Brucker
2018-09-06 11:10           ` Jean-Philippe Brucker
2018-09-06 11:10             ` Jean-Philippe Brucker
2018-09-06 11:10             ` Jean-Philippe Brucker
2018-09-06 11:10             ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 04/40] iommu/sva: Add a mm_exit callback for device drivers Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
     [not found]     ` <20180511190641.23008-5-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2018-09-05 13:23       ` Auger Eric
2018-09-05 13:23         ` Auger Eric
2018-09-05 13:23         ` Auger Eric
2018-09-05 13:23         ` Auger Eric
     [not found]         ` <d1dc28c4-7742-9c41-3f91-3fbcb8b13c1c-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-09-06 11:10           ` Jean-Philippe Brucker
2018-09-06 11:10             ` Jean-Philippe Brucker
2018-09-06 11:10             ` Jean-Philippe Brucker
2018-09-06 11:10             ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 05/40] iommu/sva: Track mm changes with an MMU notifier Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
     [not found]     ` <20180511190641.23008-6-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2018-05-17 14:25       ` Jonathan Cameron
2018-05-17 14:25         ` Jonathan Cameron
2018-05-17 14:25         ` Jonathan Cameron
2018-05-17 14:25         ` Jonathan Cameron
     [not found]         ` <20180517152514.00004247-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-05-21 14:44           ` Jean-Philippe Brucker
2018-05-21 14:44             ` Jean-Philippe Brucker
2018-05-21 14:44             ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 06/40] iommu/sva: Search mm by PASID Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 07/40] iommu: Add a page fault handler Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
     [not found]     ` <20180511190641.23008-8-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2018-05-17 15:25       ` Jonathan Cameron
2018-05-17 15:25         ` Jonathan Cameron
2018-05-17 15:25         ` Jonathan Cameron
2018-05-17 15:25         ` Jonathan Cameron
     [not found]         ` <20180517162555.00002bd3-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-05-21 14:48           ` Jean-Philippe Brucker
2018-05-21 14:48             ` Jean-Philippe Brucker
2018-05-21 14:48             ` Jean-Philippe Brucker
2018-05-21 14:48             ` Jean-Philippe Brucker
2018-05-18 18:04       ` Jacob Pan
2018-05-18 18:04         ` Jacob Pan
2018-05-18 18:04         ` Jacob Pan
2018-05-18 18:04         ` Jacob Pan
2018-05-21 14:49         ` Jean-Philippe Brucker
2018-05-21 14:49           ` Jean-Philippe Brucker
2018-05-21 14:49           ` Jean-Philippe Brucker
     [not found]           ` <8a640794-a6f3-fa01-82a9-06479a6f779a-5wv7dgnIgG8@public.gmane.org>
2018-05-22 23:35             ` Jacob Pan
2018-05-22 23:35               ` Jacob Pan
2018-05-22 23:35               ` Jacob Pan
2018-05-24 11:44               ` Jean-Philippe Brucker
2018-05-24 11:44                 ` Jean-Philippe Brucker
2018-05-24 11:44                 ` Jean-Philippe Brucker
2018-05-24 11:44                 ` Jean-Philippe Brucker
     [not found]                 ` <bdf9f221-ab97-2168-d072-b7f6a0dba840-5wv7dgnIgG8@public.gmane.org>
2018-05-26  0:35                   ` Jacob Pan
2018-05-26  0:35                     ` Jacob Pan
2018-05-26  0:35                     ` Jacob Pan
2018-05-26  0:35                     ` Jacob Pan
2018-05-29 10:00                     ` Jean-Philippe Brucker
2018-05-29 10:00                       ` Jean-Philippe Brucker
2018-05-29 10:00                       ` Jean-Philippe Brucker
2018-05-29 10:00                       ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 08/40] iommu/iopf: Handle mm faults Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 09/40] iommu/sva: Register page fault handler Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 10/40] mm: export symbol mm_access Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 11/40] mm: export symbol find_get_task_by_vpid Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 12/40] mm: export symbol mmput_async Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 13/40] vfio: Add support for Shared Virtual Addressing Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
     [not found]     ` <20180511190641.23008-14-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2018-05-17 15:58       ` Jonathan Cameron
2018-05-17 15:58         ` Jonathan Cameron
2018-05-17 15:58         ` Jonathan Cameron
2018-05-17 15:58         ` Jonathan Cameron
     [not found]         ` <20180517165845.00000cc9-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-05-21 14:51           ` Jean-Philippe Brucker
2018-05-21 14:51             ` Jean-Philippe Brucker
2018-05-21 14:51             ` Jean-Philippe Brucker
2018-05-23  9:38       ` Xu Zaibo
2018-05-23  9:38         ` Xu Zaibo
2018-05-23  9:38         ` Xu Zaibo
2018-05-23  9:38         ` Xu Zaibo
2018-05-23  9:38         ` Xu Zaibo
     [not found]         ` <5B0536A3.1000304-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-05-24 11:44           ` Jean-Philippe Brucker
2018-05-24 11:44             ` Jean-Philippe Brucker
2018-05-24 11:44             ` Jean-Philippe Brucker
2018-05-24 11:44             ` Jean-Philippe Brucker
     [not found]             ` <cd13f60d-b282-3804-4ca7-2d34476c597f-5wv7dgnIgG8@public.gmane.org>
2018-05-24 12:35               ` Xu Zaibo
2018-05-24 12:35                 ` Xu Zaibo
2018-05-24 12:35                 ` Xu Zaibo
     [not found]                 ` <5B06B17C.1090809-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-05-24 15:04                   ` Jean-Philippe Brucker
2018-05-24 15:04                     ` Jean-Philippe Brucker
2018-05-24 15:04                     ` Jean-Philippe Brucker
2018-05-24 15:04                     ` Jean-Philippe Brucker
     [not found]                     ` <205c1729-8026-3efe-c363-d37d7150d622-5wv7dgnIgG8@public.gmane.org>
2018-05-25  2:39                       ` Xu Zaibo
2018-05-25  2:39                         ` Xu Zaibo
2018-05-25  2:39                         ` Xu Zaibo
2018-05-25  2:39                         ` Xu Zaibo
2018-05-25  9:47                         ` Jean-Philippe Brucker
2018-05-25  9:47                           ` Jean-Philippe Brucker
2018-05-25  9:47                           ` Jean-Philippe Brucker
2018-05-25  9:47                           ` Jean-Philippe Brucker
     [not found]                           ` <fea420ff-e738-e2ed-ab1e-a3f4dde4b6ef-5wv7dgnIgG8@public.gmane.org>
2018-05-26  3:53                             ` Xu Zaibo
2018-05-26  3:53                               ` Xu Zaibo
     [not found]                               ` <5B08DA21.3070507-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-05-29 11:55                                 ` Jean-Philippe Brucker
2018-05-29 11:55                                   ` Jean-Philippe Brucker
2018-05-29 11:55                                   ` Jean-Philippe Brucker
2018-05-29 11:55                                   ` Jean-Philippe Brucker
     [not found]                                   ` <99ff4f89-86ef-a251-894c-8aa8a47d2a69-5wv7dgnIgG8@public.gmane.org>
2018-05-29 12:24                                     ` Xu Zaibo
2018-05-29 12:24                                       ` Xu Zaibo
2018-05-29 12:24                                       ` Xu Zaibo
2018-05-29 12:24                                       ` Xu Zaibo
2018-08-27  8:06       ` Xu Zaibo
2018-08-27  8:06         ` Xu Zaibo
2018-08-27  8:06         ` Xu Zaibo
2018-08-27  8:06         ` Xu Zaibo
2018-08-27  8:06         ` Xu Zaibo
     [not found]         ` <5B83B11E.7010807-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-08-31 13:34           ` Jean-Philippe Brucker
2018-08-31 13:34             ` Jean-Philippe Brucker
2018-08-31 13:34             ` Jean-Philippe Brucker
2018-08-31 13:34             ` Jean-Philippe Brucker
     [not found]             ` <1d5b6529-4e5a-723c-3f1b-dd5a9adb490c-5wv7dgnIgG8@public.gmane.org>
2018-09-01  2:23               ` Xu Zaibo
2018-09-01  2:23                 ` Xu Zaibo
2018-09-01  2:23                 ` Xu Zaibo
2018-09-01  2:23                 ` Xu Zaibo
2018-09-01  2:23                 ` Xu Zaibo
     [not found]                 ` <5B89F818.7060300-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-09-03 10:34                   ` Jean-Philippe Brucker
2018-09-03 10:34                     ` Jean-Philippe Brucker
2018-09-03 10:34                     ` Jean-Philippe Brucker
     [not found]                     ` <3a961aff-e830-64bb-b6a9-14e08de1abf5-5wv7dgnIgG8@public.gmane.org>
2018-09-04  2:12                       ` Xu Zaibo
2018-09-04  2:12                         ` Xu Zaibo
2018-09-04  2:12                         ` Xu Zaibo
     [not found]                         ` <5B8DEA15.7020404-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-09-04 10:57                           ` Jean-Philippe Brucker
2018-09-04 10:57                             ` Jean-Philippe Brucker
2018-09-04 10:57                             ` Jean-Philippe Brucker
2018-09-04 10:57                             ` Jean-Philippe Brucker
     [not found]                             ` <bc27f902-4d12-21b7-b9e9-18bcae170503-5wv7dgnIgG8@public.gmane.org>
2018-09-05  3:15                               ` Xu Zaibo
2018-09-05  3:15                                 ` Xu Zaibo
2018-09-05  3:15                                 ` Xu Zaibo
     [not found]                                 ` <5B8F4A59.20004-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-09-05 11:02                                   ` Jean-Philippe Brucker
2018-09-05 11:02                                     ` Jean-Philippe Brucker
2018-09-05 11:02                                     ` Jean-Philippe Brucker
     [not found]                                     ` <b51107b8-a525-13ce-f4c3-d423b8502c27-5wv7dgnIgG8@public.gmane.org>
2018-09-06  7:26                                       ` Xu Zaibo
2018-09-06  7:26                                         ` Xu Zaibo
2018-09-06  7:26                                         ` Xu Zaibo
2018-05-11 19:06   ` [PATCH v2 14/40] dt-bindings: document stall and PASID properties for IOMMU masters Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 15/40] iommu/of: Add stall and pasid properties to iommu_fwspec Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 16/40] arm64: mm: Pin down ASIDs for sharing mm with devices Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
     [not found]     ` <20180511190641.23008-17-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2018-05-15 14:16       ` Catalin Marinas
2018-05-15 14:16         ` Catalin Marinas
2018-05-15 14:16         ` Catalin Marinas
2018-05-15 14:16         ` Catalin Marinas
     [not found]         ` <20180515141658.vivrgcyww2pxumye-+1aNUgJU5qkijLcmloz0ER/iLCjYCKR+VpNB7YpNyf8@public.gmane.org>
2018-05-17 10:01           ` Jean-Philippe Brucker
2018-05-17 10:01             ` Jean-Philippe Brucker
2018-05-17 10:01             ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 17/40] iommu/arm-smmu-v3: Link domains and devices Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
     [not found]     ` <20180511190641.23008-18-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2018-05-17 16:07       ` Jonathan Cameron
2018-05-17 16:07         ` Jonathan Cameron
2018-05-17 16:07         ` Jonathan Cameron
2018-05-17 16:07         ` Jonathan Cameron
     [not found]         ` <20180517170748.00004927-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-05-21 14:49           ` Jean-Philippe Brucker
2018-05-21 14:49             ` Jean-Philippe Brucker
2018-05-21 14:49             ` Jean-Philippe Brucker
2018-09-10 15:16       ` Auger Eric
2018-09-10 15:16         ` Auger Eric
2018-09-10 15:16         ` Auger Eric
2018-05-11 19:06   ` [PATCH v2 18/40] iommu/io-pgtable-arm: Factor out ARM LPAE register defines Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 19/40] iommu: Add generic PASID table library Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 20/40] iommu/arm-smmu-v3: Move context descriptor code Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 21/40] iommu/arm-smmu-v3: Add support for Substream IDs Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
     [not found]     ` <20180511190641.23008-22-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2018-05-31 11:01       ` Bharat Kumar Gogada
2018-05-31 11:01         ` Bharat Kumar Gogada
2018-05-31 11:01         ` Bharat Kumar Gogada
2018-05-31 11:01         ` Bharat Kumar Gogada
     [not found]         ` <BLUPR0201MB1505AA55707BE2E13392FFAFA5630-hRBPhS1iNj/g9tdZWAsUFxrHTHEw16jenBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2018-06-01 10:46           ` Jean-Philippe Brucker
2018-06-01 10:46             ` Jean-Philippe Brucker
2018-06-01 10:46             ` Jean-Philippe Brucker
2018-06-01 10:46             ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 22/40] iommu/arm-smmu-v3: Add second level of context descriptor table Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 23/40] iommu/arm-smmu-v3: Share process page tables Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 24/40] iommu/arm-smmu-v3: Seize private ASID Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 25/40] iommu/arm-smmu-v3: Add support for VHE Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 26/40] iommu/arm-smmu-v3: Enable broadcast TLB maintenance Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 27/40] iommu/arm-smmu-v3: Add SVA feature checking Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 28/40] iommu/arm-smmu-v3: Implement mm operations Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 29/40] iommu/arm-smmu-v3: Add support for Hardware Translation Table Update Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 30/40] iommu/arm-smmu-v3: Register I/O Page Fault queue Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 31/40] iommu/arm-smmu-v3: Improve add_device error handling Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 32/40] iommu/arm-smmu-v3: Maintain a SID->device structure Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 33/40] iommu/arm-smmu-v3: Add stall support for platform devices Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 34/40] ACPI/IORT: Check ATS capability in root complex nodes Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 35/40] iommu/arm-smmu-v3: Add support for PCI ATS Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
     [not found]     ` <20180511190641.23008-36-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2018-05-19 17:25       ` Sinan Kaya
2018-05-19 17:25         ` Sinan Kaya
2018-05-19 17:25         ` Sinan Kaya
2018-05-19 17:25         ` Sinan Kaya
     [not found]         ` <922474e8-0aa5-e022-0502-f1e51b0d4859-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2018-05-21 14:52           ` Jean-Philippe Brucker
2018-05-21 14:52             ` Jean-Philippe Brucker
2018-05-21 14:52             ` Jean-Philippe Brucker
2018-05-21 14:52             ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 36/40] iommu/arm-smmu-v3: Hook up ATC invalidation to mm ops Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 37/40] iommu/arm-smmu-v3: Disable tagged pointers Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 38/40] PCI: Make "PRG Response PASID Required" handling common Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 39/40] iommu/arm-smmu-v3: Add support for PRI Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
     [not found]     ` <20180511190641.23008-40-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2018-05-25 14:08       ` Bharat Kumar Gogada
2018-05-25 14:08         ` Bharat Kumar Gogada
2018-05-25 14:08         ` Bharat Kumar Gogada
2018-05-25 14:08         ` Bharat Kumar Gogada
     [not found]         ` <BLUPR0201MB150513BBAA161355DE9B3A48A5690-hRBPhS1iNj/g9tdZWAsUFxrHTHEw16jenBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2018-05-29 10:27           ` Jean-Philippe Brucker
2018-05-29 10:27             ` Jean-Philippe Brucker
2018-05-29 10:27             ` Jean-Philippe Brucker
2018-05-11 19:06   ` [PATCH v2 40/40] iommu/arm-smmu-v3: Add support for PCI PASID Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker
2018-05-11 19:06     ` Jean-Philippe Brucker

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=20180907142504.5034351e@jacob-builder \
    --to=jacob.jun.pan-vuqaysv1563yd54fqh9/ca@public.gmane.org \
    --cc=Will.Deacon-5wv7dgnIgG8@public.gmane.org \
    --cc=ashok.raj-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=christian.koenig-5C7GfCeVMHo@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=ilias.apalodimas-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org \
    --cc=kevin.tian-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
    --cc=linux-pci-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=liubo95@hua \
    --cc=mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=okaya-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=rfranz-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org \
    --cc=rgummal-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org \
    --cc=xieyisheng1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.