Re: [PATCH v10 7/9] irqchip/gicv3-its: register the MSI global doorbell

2016-06-17 Thread Jean-Philippe Brucker
Hi Eric, On Tue, Jun 07, 2016 at 04:01:26PM +, Eric Auger wrote: > This patch adds the registration of the MSI global doorbell in > gicv3-its driver. > > This will allow the msi layer to iommu_map this doorbell when > requested. > > Signed-off-by: Eric Auger > --- >

Re: [RFC v5 06/17] dma-reserved-iommu: iommu_get/put_single_reserved

2016-03-10 Thread Jean-Philippe Brucker
Hi Eric, On Tue, Mar 01, 2016 at 06:27:46PM +, Eric Auger wrote: >[...] > + > +int iommu_get_single_reserved(struct iommu_domain *domain, > + phys_addr_t addr, int prot, > + dma_addr_t *iova) > +{ > + unsigned long order =

Re: [PATCH v6 6/7] dma-reserved-iommu: iommu_get/put_single_reserved

2016-04-07 Thread Jean-Philippe Brucker
Hi Eric, On Thu, Apr 07, 2016 at 11:33:42AM +0200, Eric Auger wrote: > Alex, > On 04/07/2016 01:12 AM, Alex Williamson wrote: > > On Mon, 4 Apr 2016 08:07:01 + > > Eric Auger wrote: > > > >> This patch introduces iommu_get/put_single_reserved. > >> > >>

Re: [PATCH v4 6/8] iommu/arm-smmu: Implement of_xlate() for SMMUv3

2016-07-29 Thread Jean-Philippe Brucker
Hi Robin, Very sorry about the delay, I forgot about this minor comment, below On Fri, Jul 01, 2016 at 05:50:15PM +0100, Robin Murphy wrote: > Now that we can properly describe the mapping between PCI RIDs and > stream IDs via "iommu-map", and have it fed it to the driver > automatically via

[PATCH] iommu/arm-smmu: Fix event queues synchronization

2016-08-22 Thread Jean-Philippe Brucker
synchronize the producer index and drain the queue once before leaving an event handler. In order to prevent races on the local producer index, move all event queue handling into the threads. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/iommu/arm-smmu-v3.c

Re: [RFC PATCH 30/30] vfio: Allow to bind foreign task

2017-02-28 Thread Jean-Philippe Brucker
Hi Kevin, On Tue, Feb 28, 2017 at 06:43:31AM +, Tian, Kevin wrote: > > From: Alex Williamson > > Sent: Tuesday, February 28, 2017 11:54 AM > > > > On Mon, 27 Feb 2017 19:54:41 + > > Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: > >

Re: [RFC PATCH 29/30] vfio: Add support for Shared Virtual Memory

2017-02-28 Thread Jean-Philippe Brucker
Hi Alex, Thanks for the feedback! On Mon, Feb 27, 2017 at 08:54:09PM -0700, Alex Williamson wrote: > On Mon, 27 Feb 2017 19:54:40 + > Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: [...] > > > > +static long vfio_svm_ioctl(struct vfio_device *

[RFC PATCH 06/30] iommu/arm-smmu-v3: Add support for Substream IDs

2017-02-27 Thread Jean-Philippe Brucker
troduce any change in behavior. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/iommu/arm-smmu-v3.c | 314 ++-- 1 file changed, 243 insertions(+), 71 deletions(-) diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/i

[RFC PATCH 04/30] iommu/arm-smmu-v3: Add support for PCI ATS

2017-02-27 Thread Jean-Philippe Brucker
Translation Service support by the root complex. This property is an arbitrary number of tuples of (rid-base,length). Any RID in this interval is allowed to issue address translation requests. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/iommu/arm-smmu-v3.c

[RFC PATCH 10/30] iommu/arm-smmu-v3: Add task contexts

2017-02-27 Thread Jean-Philippe Brucker
ice in a group), but the current design doesn't prevent this change. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/iommu/arm-smmu-v3.c | 316 +++- 1 file changed, 314 insertions(+), 2 deletions(-) diff --git a/drivers/iommu

[RFC PATCH 11/30] arm64: mm: Pin down ASIDs for sharing contexts with devices

2017-02-27 Thread Jean-Philippe Brucker
track of the number of references. Add a refcount value in mm_context_t for this purpose. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- arch/arm64/include/asm/mmu.h | 1 + arch/arm64/include/asm/mmu_context.h | 11 - arch/arm64/mm/con

[RFC PATCH 15/30] iommu/arm-smmu-v3: Steal private ASID from a domain

2017-02-27 Thread Jean-Philippe Brucker
, and then changes all associated stream table entries without racing with attach/detach_dev. Note that domain_free is called after devices have been removed from the group, so arm_smmu_context_share might do the whole ASID replacement dance for nothing, but it is harmless. Signed-off-by: Jean-Philippe

[RFC PATCH 00/30] Add PCIe SVM support to ARM SMMUv3

2017-02-27 Thread Jean-Philippe Brucker
c: Alex Williamson <alex.william...@redhat.com> Cc: David Woodhouse <dw...@infradead.org> Cc: linux-arm-ker...@lists.infradead.org Cc: linux-...@vger.kernel.org Cc: iommu@lists.linux-foundation.org Cc: k...@vger.kernel.org Jean-Philippe Brucker (30): iommu/arm-smmu-v3: Link groups and

[RFC PATCH 05/30] iommu/arm-smmu-v3: Disable tagged pointers when ATS is in use

2017-02-27 Thread Jean-Philippe Brucker
d pointers at all. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/iommu/arm-smmu-v3.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index e7b940146ae3..06b29d4fcf65 100644 ---

[RFC PATCH 17/30] iommu/arm-smmu-v3: Add SVM feature checking

2017-02-27 Thread Jean-Philippe Brucker
Aggregate all sanity-checks for SVM under a single ARM_SMMU_FEAT_SVM bit. For PCIe SVM, users also need to check FEAT_ATS and FEAT_PRI. For platform SVM, they will most likely have to check ARM_SMMU_FEAT_STALLS. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- d

[RFC PATCH 18/30] PCI: Make "PRG Response PASID Required" handling common

2017-02-27 Thread Jean-Philippe Brucker
, and introducing another obscure acronym to make it all fit. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/iommu/amd_iommu.c | 19 +-- drivers/pci/ats.c | 17 + include/linux/pci-ats.h | 8 includ

[RFC PATCH 03/30] PCI: Move ATS declarations outside of CONFIG_PCI

2017-02-27 Thread Jean-Philippe Brucker
. Since CONFIG_PCI_ATS is only enabled in association with CONFIG_PCI, move defines outside of CONFIG_PCI to prevent build failure when PCI is disabled. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- include/linux/pci.h | 26 +- 1 file chang

[RFC PATCH 09/30] iommu/arm-smmu-v3: Support broadcast TLB maintenance

2017-02-27 Thread Jean-Philippe Brucker
(ASID, VA) * TLBI ASIDE1IS(ASID) Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/iommu/arm-smmu-v3.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index 098115

[RFC PATCH 08/30] iommu/arm-smmu-v3: Add support for VHE

2017-02-27 Thread Jean-Philippe Brucker
in the SMMU and for all streams. Normal DMA mappings will need to use TLBI_EL2 commands instead of TLBI_NH, but shouldn't be otherwise affected by this change. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/iommu/arm-smmu-v3.c | 29 -

[RFC PATCH 13/30] iommu/io-pgtable-arm: Factor out ARM LPAE register defines

2017-02-27 Thread Jean-Philippe Brucker
For unified address space, we'll need to extract CPU page table information and mirror it in the substream setup. Move relevant defines to a common header. Fix TCR_SZ_MASK while we're at it. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- MAINT

[RFC PATCH 14/30] iommu/arm-smmu-v3: Share process page tables

2017-02-27 Thread Jean-Philippe Brucker
Copy the content of TCR, MAIR and TTBR of a given task into a context descriptor. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/iommu/arm-smmu-v3.c | 39 +-- 1 file changed, 37 insertions(+), 2 deletions(-) diff

[RFC PATCH 16/30] iommu/arm-smmu-v3: Use shared ASID set

2017-02-27 Thread Jean-Philippe Brucker
. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/iommu/arm-smmu-v3.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index 3af47b1427a6..86d5430bd68d 100644 --- a/drivers/iommu/ar

[RFC PATCH 21/30] iommu/arm-smmu-v3: Handle device faults from PRI

2017-02-27 Thread Jean-Philippe Brucker
Marker Message", characterized by flags Read=Write=Last=0. This tells software that all previous PPRs containing this PASID are invalid, and the next PPRs with this PASID belong to a different address space. Subsequent patches handle Stop Markers and overflow of the queue. Signed-off-by: Jean-Ph

[RFC PATCH 23/30] iommu/arm-smmu-v3: Bind/unbind device and task

2017-02-27 Thread Jean-Philippe Brucker
Now that everything is in place, implement bind and unbind operations. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/iommu/arm-smmu-v3.c | 178 +++- 1 file changed, 175 insertions(+), 3 deletions(-) diff --git a/d

[RFC PATCH 22/30] iommu: Bind/unbind tasks to/from devices

2017-02-27 Thread Jean-Philippe Brucker
ified Address Space is already used by USB. Same for Shared Address Space (SAS), already in use in the kernel, but SVAS would work (although it doesn't look good). Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/iommu/iommu.c | 108 +++

[RFC PATCH 25/30] iommu/arm-smmu-v3: Safe invalidation and recycling of PASIDs

2017-02-27 Thread Jean-Philippe Brucker
n the PRIQ when we marked the context stale, has now been removed and pushed out to the fault work queue. Flush the work queue and remove the context. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/iommu/arm-smmu-v3.c | 269 ++

[RFC PATCH 24/30] iommu: Specify PASID state when unbinding a task

2017-02-27 Thread Jean-Philippe Brucker
, the PPR will trigger a fault in the wrong address space. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/iommu/iommu.c | 8 include/linux/iommu.h | 18 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers

[RFC PATCH 26/30] iommu/arm-smmu-v3: Fix PRI queue overflow acknowledgement

2017-02-27 Thread Jean-Philippe Brucker
n't matter. We won't miss fault records for stalled transactions. But it feels nicer to keep the SMMU in sync when possible, so do it there as well. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/iommu/arm-smmu-v3.c | 14 -- 1 file changed, 12 i

[RFC PATCH 28/30] iommu/arm-smmu-v3: Add support for Hardware Translation Table Update at stage 1

2017-02-27 Thread Jean-Philippe Brucker
If the SMMU supports it and the kernel was built with HTTU support, enable hardware update of access and dirty flags. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/iommu/arm-smmu-v3.c | 27 ++- 1 file changed, 26 insertions

[RFC PATCH 19/30] PCI: Cache PRI and PASID bits in pci_dev

2017-02-27 Thread Jean-Philippe Brucker
Device drivers need to check if an IOMMU enabled ATS, PRI and PASID in order to know when they can use the SVM API. Cache PRI and PASID bits in the pci_dev structure, similarly to what is currently done for ATS. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drive

[RFC PATCH 20/30] iommu/arm-smmu-v3: Enable PCI PASID in masters

2017-02-27 Thread Jean-Philippe Brucker
Enable PASID for PCI devices that support it. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/iommu/arm-smmu-v3.c | 66 ++--- 1 file changed, 63 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/arm-smmu-

[RFC PATCH 12/30] iommu/arm-smmu-v3: Keep track of process address spaces

2017-02-27 Thread Jean-Philippe Brucker
a patch of its own. * Register an MMU notifier to mirror invalidations of the system's TLBs with a device's ATC. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/iommu/arm-smmu-v3.c | 171 +++- 1 file change

[RFC PATCH 02/30] iommu/arm-smmu-v3: Link groups and domains

2017-02-27 Thread Jean-Philippe Brucker
protected by iommu_group->mutex, the domain-to-group lookup will be done outside of the sections protected by that mutex. Add a spinlock for this case. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/iommu/arm-smmu-

[RFC PATCH 07/30] iommu/arm-smmu-v3: Add second level of context descriptor table

2017-02-27 Thread Jean-Philippe Brucker
on demand. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/iommu/arm-smmu-v3.c | 251 +++- 1 file changed, 223 insertions(+), 28 deletions(-) diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c

[RFC PATCH 01/30] iommu/arm-smmu-v3: Link groups and devices

2017-02-27 Thread Jean-Philippe Brucker
in their ATC. It would be nice to use IOMMU API's iommu_group_for_each_dev, but that list is protected by group->mutex, which we can't use because atc_invalidate won't be allowed to sleep. So add a list of devices, protected by a spinlock. Signed-off-by: Jean-Philippe Brucker <jean-philipp

[RFC PATCH 27/30] iommu/arm-smmu-v3: Handle PRI queue overflow

2017-02-27 Thread Jean-Philippe Brucker
nd destroy *all* remaining PRG structures :( We do that by appending a PRG sweeper work to the fault queue, that will do some inefficient sweeping and lock up the fault queue for a while. Awful, but necessary. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> -

[RFC PATCH 29/30] vfio: Add support for Shared Virtual Memory

2017-02-27 Thread Jean-Philippe Brucker
compatible string, as is currently done for reset. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/vfio/pci/vfio_pci.c | 24 ++ drivers/vfio/vfio.c | 104 include/uapi/linux/vfio.h | 55

[RFC PATCH 30/30] vfio: Allow to bind foreign task

2017-02-27 Thread Jean-Philippe Brucker
transaction tagged with the given PASID. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/vfio/vfio.c | 35 +-- include/uapi/linux/vfio.h | 15 +++ 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/driver

[PATCH] iommu/arm-smmu: Fix polling of command queue

2016-09-05 Thread Jean-Philippe Brucker
now straightforward: * When we want to add a command and the list is full, wait until it isn't full and retry. * After adding a sync, wait for the list to be empty before returning. Suggested-by: Will Deacon <will.dea...@arm.com> Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@ar

Re: [PATCH] iommu/arm-smmu: Disable interrupts whilst holding the cmdq lock

2016-09-09 Thread Jean-Philippe Brucker
or me and keeps lockdep quiet, so FWIW Tested-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> > --- > drivers/iommu/arm-smmu-v3.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/a

Re: [RFC PATCH 04/30] iommu/arm-smmu-v3: Add support for PCI ATS

2017-03-21 Thread Jean-Philippe Brucker
On 08/03/17 15:26, Sinan Kaya wrote: > On 2/27/2017 2:54 PM, Jean-Philippe Brucker wrote: >> +ats_enabled = !arm_smmu_enable_ats(master); >> + > > You should make ats_supported field in IORT table part of the decision > process for when to enable ATS. > Agreed. I

Re: [RFC PATCH 29/30] vfio: Add support for Shared Virtual Memory

2017-03-21 Thread Jean-Philippe Brucker
more generic below. >> -Original Message- >> From: iommu-boun...@lists.linux-foundation.org [mailto:iommu- >> boun...@lists.linux-foundation.org] On Behalf Of Jean-Philippe Brucker >> Sent: Tuesday, February 28, 2017 3:55 AM >> Cc: Shanker Donthineni <sha

Re: [RFC PATCH 24/30] iommu: Specify PASID state when unbinding a task

2017-03-24 Thread Jean-Philippe Brucker
On 24/03/17 11:00, Joerg Roedel wrote: > On Thu, Mar 23, 2017 at 05:03:46PM +0000, Jean-Philippe Brucker wrote: >> On 23/03/17 16:52, Joerg Roedel wrote: >>> Thanks for that, I have a closer look. Is that stopper packet visible to >>> software (e.g. is an entry created

Re: [RFC PATCH 29/30] vfio: Add support for Shared Virtual Memory

2017-03-27 Thread Jean-Philippe Brucker
On 24/03/17 07:46, Liu, Yi L wrote: [...] So we need some kind of high-level classification that the vIOMMU must communicate to the physical one. Each IOMMU flavor would get a unique, global identifier, simply to make sure that vIOMMU and pIOMMU speak >> the same language.

Re: [RFC PATCH 21/30] iommu/arm-smmu-v3: Handle device faults from PRI

2017-03-27 Thread Jean-Philippe Brucker
Hi Valmiki, On 25/03/17 05:16, valmiki wrote: >> When we receive a PRI Page Request (PPR) from the SMMU, it contains a >> context identifier SID:SSID, an IOVA and the requested access flags. >> >> Search the domain corresponding to SID:SSID, and call handle_mm_fault on >> its mm. If memory

Re: [RFC PATCH 24/30] iommu: Specify PASID state when unbinding a task

2017-03-22 Thread Jean-Philippe Brucker
On 22/03/17 15:44, Joerg Roedel wrote: > On Mon, Feb 27, 2017 at 07:54:35PM +0000, Jean-Philippe Brucker wrote: >> It is an important distinction because, if the IOMMU driver reassigns a >> PASID while the IOMMU still holds pending PPR targeting that PASID >> internally,

Re: [RFC PATCH 22/30] iommu: Bind/unbind tasks to/from devices

2017-03-22 Thread Jean-Philippe Brucker
Hi Joerg, On 22/03/17 15:36, Joerg Roedel wrote: > On Fri, Mar 03, 2017 at 06:39:58PM +0000, Jean-Philippe Brucker wrote: >> Yes, it would be nice to have a common PASID allocator. But I don't >> think that a system-wide PASID space is workable for us. At the moment >> sys

Re: [RFC PATCH 29/30] vfio: Add support for Shared Virtual Memory

2017-03-23 Thread Jean-Philippe Brucker
On 23/03/17 08:39, Liu, Yi L wrote: > Hi Jean, > > Thx for the excellent ideas. Pls refer to comments inline. > > [...] > >>> Hi Jean, >>> >>> I'm working on virtual SVM, and have some comments on the VFIO channel >>> definition. >> >> Thanks a lot for the comments, this is quite interesting to

Re: [RFC PATCH 24/30] iommu: Specify PASID state when unbinding a task

2017-03-23 Thread Jean-Philippe Brucker
On 22/03/17 22:53, Joerg Roedel wrote: > On Wed, Mar 22, 2017 at 06:31:01PM +0000, Jean-Philippe Brucker wrote: >> The problem might be too tied to the specifics of the SMMU. As implemented >> in this series, the normal flow for a PPR with the SMMU is the following: >> >

Re: [RFC PATCH 24/30] iommu: Specify PASID state when unbinding a task

2017-03-23 Thread Jean-Philippe Brucker
On 23/03/17 16:52, Joerg Roedel wrote: > On Thu, Mar 23, 2017 at 03:52:14PM +0000, Jean-Philippe Brucker wrote: >> On 23/03/17 14:30, Joerg Roedel wrote: >>> Are you sure about the meaning of the stop-marker? Can you point me to >>> where it is specified? >> >&g

Re: [RFC PATCH 24/30] iommu: Specify PASID state when unbinding a task

2017-03-23 Thread Jean-Philippe Brucker
On 23/03/17 14:30, Joerg Roedel wrote: > On Thu, Mar 23, 2017 at 01:37:41PM +0000, Jean-Philippe Brucker wrote: >> On 22/03/17 22:53, Joerg Roedel wrote: >>> That can't happen, when the device driver does its job right. It has to >>> shut down the context wh

Re: [RFC PATCH 04/30] iommu/arm-smmu-v3: Add support for PCI ATS

2017-04-03 Thread Jean-Philippe Brucker
On 03/04/17 09:34, Sunil Kovvuri wrote: >> +static size_t arm_smmu_atc_invalidate_domain(struct arm_smmu_domain >> *smmu_domain, >> +unsigned long iova, size_t size) >> +{ >> + unsigned long flags; >> + struct arm_smmu_cmdq_ent cmd = {0}; >>

Re: [virtio-dev] Re: [RFC 0/3] virtio-iommu: a paravirtualized IOMMU

2017-04-10 Thread Jean-Philippe Brucker
On 07/04/17 22:19, Michael S. Tsirkin wrote: > On Fri, Apr 07, 2017 at 08:17:44PM +0100, Jean-Philippe Brucker wrote: >> There are a number of advantages in a paravirtualized IOMMU over a full >> emulation. It is portable and could be reused on different architectures. >> It i

Re: [RFC PATCH 04/30] iommu/arm-smmu-v3: Add support for PCI ATS

2017-04-03 Thread Jean-Philippe Brucker
On 03/04/17 12:42, Sunil Kovvuri wrote: > On Mon, Apr 3, 2017 at 3:44 PM, Jean-Philippe Brucker > <jean-philippe.bruc...@arm.com> wrote: >> On 03/04/17 09:34, Sunil Kovvuri wrote: >>>> +static size_t arm_smmu_atc_invalidate_domain(struct arm_

Re: [RFC PATCH 01/30] iommu/arm-smmu-v3: Link groups and devices

2017-04-10 Thread Jean-Philippe Brucker
On 27/03/17 13:18, Robin Murphy wrote: > Hi Jean-Philippe, > > On 27/02/17 19:54, Jean-Philippe Brucker wrote: >> Reintroduce smmu_group. This structure was removed during the generic DT >> bindings rework, but will be needed when implementing PCIe ATS, to lookup >>

Re: [RFC 0/3] virtio-iommu: a paravirtualized IOMMU

2017-04-13 Thread Jean-Philippe Brucker
On 13/04/17 09:16, Tian, Kevin wrote: >> From: Jason Wang >> Sent: Wednesday, April 12, 2017 5:07 PM >> >> On 2017年04月08日 03:17, Jean-Philippe Brucker wrote: >>> This is the initial proposal for a paravirtualized IOMMU device using >>> virtio transpor

Re: [RFC 0/3] virtio-iommu: a paravirtualized IOMMU

2017-04-13 Thread Jean-Philippe Brucker
On 13/04/17 09:41, Tian, Kevin wrote: >> From: Jean-Philippe Brucker >> Sent: Saturday, April 8, 2017 3:18 AM >> >> This is the initial proposal for a paravirtualized IOMMU device using >> virtio transport. It contains a description of the device, a Linux drive

Re: [RFC 1/3] virtio-iommu: firmware description of the virtual topology

2017-04-18 Thread Jean-Philippe Brucker
On 18/04/17 10:51, Tian, Kevin wrote: >> From: Jean-Philippe Brucker >> Sent: Saturday, April 8, 2017 3:18 AM >> >> Unlike other virtio devices, the virtio-iommu doesn't work independently, >> it is linked to other virtual or assigned devices. So before jumping into

Re: [RFC 2/3] virtio-iommu: device probing and operations

2017-04-18 Thread Jean-Philippe Brucker
On 18/04/17 11:26, Tian, Kevin wrote: >> From: Jean-Philippe Brucker >> Sent: Saturday, April 8, 2017 3:18 AM >> > [...] >> II. Feature bits >> >> >> VIRTIO_IOMMU_F_INPUT_RANGE (0) >> Available range of virtual addr

Re: [RFC PATCH 22/30] iommu: Bind/unbind tasks to/from devices

2017-03-03 Thread Jean-Philippe Brucker
Hi David, On Fri, Mar 03, 2017 at 09:40:44AM +, David Woodhouse wrote: > On Mon, 2017-02-27 at 19:54 +0000, Jean-Philippe Brucker wrote: > > Add three functions to the IOMMU API. iommu_bind_task takes a device and a > > task as argument. If the IOMMU, the device and the bus sup

Re: [PATCH V8 01/11] iommu/of: Refactor of_iommu_configure() for error handling

2017-03-08 Thread Jean-Philippe Brucker
Hello, On 03/02/17 15:48, Sricharan R wrote: > From: Robin Murphy > > In preparation for some upcoming cleverness, rework the control flow in > of_iommu_configure() to minimise duplication and improve the propogation > of errors. It's also as good a time as any to switch

Re: [RFC PATCH 00/30] Add PCIe SVM support to ARM SMMUv3

2017-03-06 Thread Jean-Philippe Brucker
Hi Yi, On 06/03/17 08:20, Liu, Yi L wrote: > > >> -Original Message- >> From: iommu-boun...@lists.linux-foundation.org [mailto:iommu- >> boun...@lists.linux-foundation.org] On Behalf Of Jean-Philippe Brucker >> Sent: Tuesday, February 28, 2017 3:54 AM &g

Re: [RFC PATCH 18/30] PCI: Make "PRG Response PASID Required" handling common

2017-03-06 Thread Jean-Philippe Brucker
On Fri, Mar 03, 2017 at 03:11:40PM -0600, Bjorn Helgaas wrote: > On Mon, Feb 27, 2017 at 07:54:29PM +0000, Jean-Philippe Brucker wrote: > > The PASID ECN to the PCIe spec added a bit in the PRI status register that > > allows a Function to declare whether a PRG Response

Re: [RFC PATCH 03/30] PCI: Move ATS declarations outside of CONFIG_PCI

2017-03-06 Thread Jean-Philippe Brucker
Hi Bjorn, On 03/03/17 21:09, Bjorn Helgaas wrote: > On Mon, Feb 27, 2017 at 07:54:14PM +0000, Jean-Philippe Brucker wrote: >> Currently ATS helpers like pci_enable_ats are only defined when CONFIG_PCI >> is enabled. The ARM SMMU driver might get built with CONFIG_PCI disabled. &

Re: [RFC PATCH 30/30] vfio: Allow to bind foreign task

2017-03-02 Thread Jean-Philippe Brucker
On Wed, Mar 01, 2017 at 08:02:09AM +, Tian, Kevin wrote: > > From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > > Sent: Tuesday, February 28, 2017 11:23 PM > > > > Hi Kevin, > > > > On Tue, Feb 28, 2017 at 06:43:31AM +, Tian, Kevin

Re: [RFC PATCH 04/30] iommu/arm-smmu-v3: Add support for PCI ATS

2017-03-02 Thread Jean-Philippe Brucker
Hi Sinan, On 01/03/17 19:24, Sinan Kaya wrote: > On 2/27/2017 2:54 PM, Jean-Philippe Brucker wrote: >> /* Initialise command lazily */ >> +if (!cmd.opcode) >> +arm_smmu_atc_invalidate_to_cmd(smmu, iova, size, ); >> + >> +

[RFC 3/3] virtio-iommu: future work

2017-04-07 Thread Jean-Philippe Brucker
Here I propose a few ideas for extensions and optimizations. This is all very exploratory, feel free to correct mistakes and suggest more things. I. Linux host 1. vhost-iommu 2. VFIO nested translation II. Page table sharing 1. Sharing

[RFC 2/3] virtio-iommu: device probing and operations

2017-04-07 Thread Jean-Philippe Brucker
After the virtio-iommu device has been probed and the driver is aware of the devices translated by the IOMMU, it can start sending requests to the virtio-iommu device. The operations described here are voluntarily minimalistic, so vIOMMU devices can be as simple as possible to implement, and can

[RFC 0/3] virtio-iommu: a paravirtualized IOMMU

2017-04-07 Thread Jean-Philippe Brucker
This is the initial proposal for a paravirtualized IOMMU device using virtio transport. It contains a description of the device, a Linux driver, and a toy implementation in kvmtool. With this prototype, you can translate DMA to guest memory from emulated (virtio), or passed-through (VFIO) devices.

[RFC 1/3] virtio-iommu: firmware description of the virtual topology

2017-04-07 Thread Jean-Philippe Brucker
Unlike other virtio devices, the virtio-iommu doesn't work independently, it is linked to other virtual or assigned devices. So before jumping into device operations, we need to define a way for the guest to discover the virtual IOMMU and the devices it translates. The host must describe the

[RFC PATCH linux] iommu: Add virtio-iommu driver

2017-04-07 Thread Jean-Philippe Brucker
be calmer in next versions. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- drivers/iommu/Kconfig | 11 + drivers/iommu/Makefile| 1 + drivers/iommu/virtio-iommu.c | 980 ++ include/uapi/linux/

[RFC PATCH kvmtool 02/15] FDT: (re)introduce a dynamic phandle allocator

2017-04-07 Thread Jean-Philippe Brucker
-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- Makefile | 1 + arm/include/arm-common/fdt-arch.h | 2 +- fdt.c | 15 +++ include/kvm/fdt.h | 13 + mips/include/kvm/fdt-arch.h

[RFC PATCH kvmtool 01/15] virtio: synchronize virtio-iommu headers with Linux

2017-04-07 Thread Jean-Philippe Brucker
Pull virtio-iommu header (initial proposal) from Linux. Also add virtio_config.h because it defines VIRTIO_F_IOMMU_PLATFORM, which I'm going to need soon, and it's not provided by my toolchain. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- include/linux/virtio_co

[RFC PATCH kvmtool 13/15] virtio-iommu: debug via IPC

2017-04-07 Thread Jean-Philippe Brucker
Add a new parameter to lkvm debug, '-i' or '--iommu'. Commands will be added later. For the moment, rework the debug builtin to share dump facilities with the '-d'/'--dump' parameter. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- builtin-debug.c

[RFC PATCH kvmtool 14/15] virtio-iommu: implement basic debug commands

2017-04-07 Thread Jean-Philippe Brucker
stics at the moment, since there is no concurrent write on most of them. Only 'accesses' might be incremented concurrently, so we might get imprecise values. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- include/kvm/iommu.h | 17

[RFC PATCH kvmtool 12/15] vfio: add support for virtual IOMMU

2017-04-07 Thread Jean-Philippe Brucker
to be attached to the same address space, they all have different page tables. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- include/kvm/iommu.h | 6 ++ include/kvm/vfio.h | 2 + iommu.c | 7 +- vfio.c

[RFC PATCH kvmtool 11/15] virtio: set VIRTIO_F_IOMMU_PLATFORM when necessary

2017-04-07 Thread Jean-Philippe Brucker
performance. Cowardly ignore this. VIRTIO_RING_F_EVENT_IDX is another feature of the vring, but that one needs the device to call virtio_queue__should_signal before signaling to the guest. Arguably we could factor all calls to signal_vq, but let's keep this patch simple. Signed-off-by: Jean-Philippe

[RFC PATCH kvmtool 09/15] virtio: access vring and buffers through IOMMU mappings

2017-04-07 Thread Jean-Philippe Brucker
-Philippe Brucker <jean-philippe.bruc...@arm.com> --- include/kvm/virtio.h | 108 +-- virtio/core.c| 179 ++- 2 files changed, 252 insertions(+), 35 deletions(-) diff --git a/include/kvm/virtio.h b/include/kvm/vi

[RFC PATCH kvmtool 06/15] irq: register MSI doorbell addresses

2017-04-07 Thread Jean-Philippe Brucker
For passed-through devices behind a vIOMMU, we'll need to translate writes to MSI vectors. Let the IRQ code register MSI doorbells, and add a simple way for other systems to check if an address is a doorbell. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- arm

[RFC PATCH kvmtool 05/15] iommu: describe IOMMU topology in device-trees

2017-04-07 Thread Jean-Philippe Brucker
in kvmtool. Add an "iommus" property to plaform devices that are behind an iommu. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- arm/pci.c | 49 - fdt.c | 20 include/kvm/

[RFC PATCH kvmtool 00/15] Add virtio-iommu

2017-04-07 Thread Jean-Philippe Brucker
ARM Juno. [1] http://www.spinics.net/lists/kvm/msg147624.html Jean-Philippe Brucker (15): virtio: synchronize virtio-iommu headers with Linux FDT: (re)introduce a dynamic phandle allocator virtio: add virtio-iommu Add a simple IOMMU iommu: describe IOMMU topology in device-trees irq: r

[RFC PATCH kvmtool 03/15] virtio: add virtio-iommu

2017-04-07 Thread Jean-Philippe Brucker
MMU features. Add a global --viommu parameter to enable the virtual IOMMU. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- Makefile | 1 + builtin-run.c | 2 + include/kvm/devices.h | 4 + include/kvm/iommu.h| 64 +

[RFC PATCH kvmtool 10/15] virtio-pci: translate MSIs with the virtual IOMMU

2017-04-07 Thread Jean-Philippe Brucker
into a physical one, and store it in a secondary table for easy access. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- include/kvm/iommu.h | 4 include/kvm/virtio-pci.h | 1 + iommu.c | 23 +++ virtio/pci.c

[RFC PATCH kvmtool 08/15] virtio: add vIOMMU instance for virtio devices

2017-04-07 Thread Jean-Philippe Brucker
Virtio devices can now opt-in to use an IOMMU, by setting the use_iommu field. None of this will work in the current state, since virtio devices still access memory linearly. A subsequent patch implements sg accesses. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.

[RFC PATCH kvmtool 07/15] virtio: factor virtqueue initialization

2017-04-07 Thread Jean-Philippe Brucker
All virtio devices are doing the same few operations when initializing their virtqueues. Move these operations to virtio core, as we'll have to complexify vring initialization when implementing a virtual IOMMU. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- inclu

[RFC PATCH kvmtool 15/15] virtio: use virtio-iommu when available

2017-04-07 Thread Jean-Philippe Brucker
This is for development only. Virtual devices might blow up unexpectedly. In general it seems to work (slowing devices down by a factor of two of course). virtio-scsi, virtio-rng and virtio-balloon are still untested. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.

[RFC PATCH kvmtool 04/15] Add a simple IOMMU

2017-04-07 Thread Jean-Philippe Brucker
Add a rb-tree based IOMMU with support for map, unmap and access operations. It will be used to store mappings for virtio devices and MSI doorbells. If needed, it could also be extended with a TLB implementation. Signed-off-by: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> --- Ma

Re: Support SVM without PASID

2017-08-01 Thread Jean-Philippe Brucker
Hi Valmiki, Sorry for the delay, I was away last week. On 22/07/17 03:05, valmiki wrote: > On 7/12/2017 10:18 PM, Jean-Philippe Brucker wrote: >> On 12/07/17 17:27, valmiki wrote: >>> On 7/11/2017 4:26 PM, Jean-Philippe Brucker wrote: >>>> Hi Valmiki, >>>

Re: Support SVM without PASID

2017-08-04 Thread Jean-Philippe Brucker
Hi Kevin, On 04/08/17 02:49, Tian, Kevin wrote: >> From: Jean-Philippe Brucker >> Sent: Tuesday, August 1, 2017 4:26 PM >> >> It depends what type you use when registering the IOMMU with >> VFIO_SET_IOMMU: >> >> * If the type is VFIO_TYPE1v2_IOMMU, the

Re: Support SVM without PASID

2017-08-11 Thread Jean-Philippe Brucker
On 11/08/17 07:41, Tian, Kevin wrote: [...] >>> Hi Jean, >>> >>> I think there is another way to support SVM without PASID. >>> >>> Suppose there is a device in the same SOC-chip, the device access memory >> through SMMU(using internal bus instead of PCIe) >>> Once page fault, the device send an

Re: [RFC] virtio-iommu version 0.4

2017-08-14 Thread Jean-Philippe Brucker
On 14/08/17 09:27, Tian, Kevin wrote: >> * First, since the IOMMU is paravirtualized, the device can expose some >> properties of the physical topology to the guest, and let it allocate >> resources more efficiently. For example, when the virtio-iommu manages >> both physical and emulated

Re: Support SVM without PASID

2017-08-14 Thread Jean-Philippe Brucker
On 14/08/17 09:00, Tian, Kevin wrote: >> From: Raj, Ashok >> Sent: Saturday, August 12, 2017 12:25 AM >> >> On Fri, Aug 04, 2017 at 10:42:41AM +0100, Jean-Philippe Brucker wrote: >>> Hi Kevin, >>> >>> >>> Consider the situation where a u

Re: [virtio-dev] [RFC] virtio-iommu version 0.4

2017-08-17 Thread Jean-Philippe Brucker
Hi Adam, On 16/08/17 05:08, Adam Tao wrote: >> * There is a working Qemu prototype [3], thanks to Eric Auger and Bharat >> Bhushan. > Hi, Brucker > I read the related spec for virtio IOMMU, > I am wondering if we support both the virtual and physical devices in > the guest to use the virtio

Re: [RFC 0/2] arm-smmu-v3 tlbi-on-map option

2017-07-13 Thread Jean-Philippe Brucker
On 13/07/17 18:44, Michael S. Tsirkin wrote: > On Thu, Jul 13, 2017 at 10:29:42AM +0100, Jean-Philippe Brucker wrote: >> On 12/07/17 23:07, Michael S. Tsirkin wrote: >> [...] >>> I think using hardware support for nesting is the right final >>> solution. It

Re: What differences and relations between SVM, HSA, HMM and Unified Memory?

2017-07-17 Thread Jean-Philippe Brucker
On 17/07/17 12:57, Yisheng Xie wrote: > Hi Jean-Philippe, > > On 2017/6/12 19:37, Jean-Philippe Brucker wrote: >> Hello, >> >> On 10/06/17 05:06, Wuzongyong (Cordius Wu, Euler Dept) wrote: >>> Hi, >>> >>> Could someone explain differences a

Re: Support SVM without PASID

2017-07-11 Thread Jean-Philippe Brucker
Hi Valmiki, On 09/07/17 04:15, valmiki wrote: >>> Hi, >>> >>> In SMMUv3 architecture document i see "PASIDs are optional, >>> configurable, and of a size determined by the minimum >>> of the endpoint". >>> >>> So if PASID's are optional and not supported by PCIe end point, how SVM >>> can be

Re: Support SVM without PASID

2017-07-12 Thread Jean-Philippe Brucker
On 12/07/17 17:27, valmiki wrote: > On 7/11/2017 4:26 PM, Jean-Philippe Brucker wrote: >> Hi Valmiki, >> >> On 09/07/17 04:15, valmiki wrote: >>>>> Hi, >>>>> >>>>> In SMMUv3 architecture document i see "PASIDs ar

Re: [RFC 0/2] arm-smmu-v3 tlbi-on-map option

2017-07-13 Thread Jean-Philippe Brucker
On 12/07/17 23:07, Michael S. Tsirkin wrote: [...] > I think using hardware support for nesting is the right final > solution. It will take some time though. Given this, what should > we do meanwhile? > > Assuming that's the final destination, a simple quirk like this > seems to be preferable to

Re: [Qemu-devel] [RFC PATCH 7/8] VFIO: Add new IOCTL for IOMMU TLB invalidate propagation

2017-07-18 Thread Jean-Philippe Brucker
On 17/07/17 23:45, Alex Williamson wrote: [..] >>> >>> How does a user learn which model(s) are supported by the interface? >>> How do they learn which ops are supported? Perhaps a good use for one of >>> those >>> flag bits in the outer data structure is "probe". >> >> My initial plan to user

Re: [Qemu-devel] [RFC PATCH 7/8] VFIO: Add new IOCTL for IOMMU TLB invalidate propagation

2017-07-18 Thread Jean-Philippe Brucker
On 18/07/17 15:29, Alex Williamson wrote: > On Tue, 18 Jul 2017 10:38:40 +0100 > Jean-Philippe Brucker <jean-philippe.bruc...@arm.com> wrote: > >> On 17/07/17 23:45, Alex Williamson wrote: >> [..] >>>>> >>>>> How does a user learn wh

  1   2   3   4   5   6   7   >