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

2017-09-20 Thread Tian, Kevin
> From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > Sent: Wednesday, September 6, 2017 7:49 PM > > > > 2.6.8.2.1 > > Multiple overlapping RESV_MEM properties are merged together. Device > > requirement? if same types I assume? > > Combination rules apply to device and driver.

RE: [RFC] virtio-iommu version 0.4

2017-09-20 Thread Tian, Kevin
> From: Jean-Philippe Brucker > Sent: Wednesday, September 6, 2017 7:55 PM > > Hi Kevin, > > On 28/08/17 08:39, Tian, Kevin wrote: > > Here comes some comments: > > > > 1.1 Motivation > > > > You describe I/O page faults handling as future work. Seems you > considered > > only recoverable fault (

RE: bind pasid table API

2017-09-20 Thread Liu, Yi L
Hi Jean, > -Original Message- > From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > Sent: Wednesday, September 20, 2017 8:10 PM > To: Pan, Jacob jun ; iommu@lists.linux- > foundation.org > Cc: Liu, Yi L ; Raj, Ashok ; David > Woodhouse ; Joerg Roedel ; Tian, > Kevin ; Auge

Re: bind pasid table API

2017-09-20 Thread Jacob Pan
On Wed, 20 Sep 2017 13:09:47 +0100 Jean-Philippe Brucker wrote: > Hi Jacob, > > [Adding Eric as he might need pasid_table_info for vSVM at some point] > > On 19/09/17 04:45, Jacob Pan wrote: > > Hi Jean and All, > > > > This is a follow-up on the LPC discussion we had last week. > > (https://l

[GIT PULL] a dma-mapping fix for 4.14-rc2

2017-09-20 Thread Christoph Hellwig
Hi Linus, below is a single fix for an issue that crept in with the previous pull request. The following changes since commit 2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e: Linux 4.14-rc1 (2017-09-16 15:47:51 -0700) are available in the git repository at: git://git.infradead.org/users/hch/dma-

Re: [PATCH v4 5/6] iommu/iova: Extend rbtree node caching

2017-09-20 Thread Robin Murphy
On 20/09/17 13:59, Tomasz Nowicki wrote: > Hi Robin, > > On 19.09.2017 18:31, Robin Murphy wrote: >> The cached node mechanism provides a significant performance benefit for >> allocations using a 32-bit DMA mask, but in the case of non-PCI devices >> or where the 32-bit space is full, the loss of

[PATCH] iommu/iova: Improve alloc_iova performance

2017-09-20 Thread David Woods
When allocating pages with alloc_iova() where limit_pfn > dma_32bit_pfn __alloc_and_insert_iova_range does a linear traversal of the tree to find a free block. In the worst case it makes the alloc O(n) for each page, where n is the number of pages allocated so far. The worst case turns out to be

Re: [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to fix iommmu build

2017-09-20 Thread Alex Williamson
On Mon, 11 Sep 2017 14:29:15 +0200 Geert Uytterhoeven wrote: > If CONFIG_PCI=n, and gcc (e.g. 4.1.2) decides not to inline > get_pci_function_alias_group(), the build fails with: > > drivers/iommu/iommu.o: In function `get_pci_function_alias_group': > iommu.c:(.text+0xfdc): undefined ref

[PATCH v2] iommu/ipmmu-vmsa: Do not replace bus IOMMU ops on driver init.

2017-09-20 Thread Liviu Dudau
If the IPMMU driver is compiled in the kernel it will replace the platform bus IOMMU ops on running the ipmmu_init() function, regardless if there is any IPMMU hardware present or not. This screws up systems that just want to build a generic kernel that runs on multiple platforms and use a differen

Re: [PATCH v4 5/6] iommu/iova: Extend rbtree node caching

2017-09-20 Thread Tomasz Nowicki
Hi Robin, On 19.09.2017 18:31, Robin Murphy wrote: The cached node mechanism provides a significant performance benefit for allocations using a 32-bit DMA mask, but in the case of non-PCI devices or where the 32-bit space is full, the loss of this benefit can be significant - on large systems th

Re: [PATCH] pci: Add dummy for pci_acs_enabled() if CONFIG_PCI=n to fix iommmu build

2017-09-20 Thread Joerg Roedel
Hey Bjorn, On Mon, Sep 11, 2017 at 02:29:15PM +0200, Geert Uytterhoeven wrote: > If CONFIG_PCI=n, and gcc (e.g. 4.1.2) decides not to inline > get_pci_function_alias_group(), the build fails with: > > drivers/iommu/iommu.o: In function `get_pci_function_alias_group': > iommu.c:(.text+0xfd

Re: bind pasid table API

2017-09-20 Thread Jean-Philippe Brucker
Hi Jacob, [Adding Eric as he might need pasid_table_info for vSVM at some point] On 19/09/17 04:45, Jacob Pan wrote: > Hi Jean and All, > > This is a follow-up on the LPC discussion we had last week. > (https://linuxplumbersconf.org/2017/ocw/proposals/4748) > > My understanding is that the data

Re: DMA error when sg->offset value is greater than PAGE_SIZE in Intel IOMMU

2017-09-20 Thread Harsh Jain
On 20-09-2017 13:31, Herbert Xu wrote: > Harsh Jain wrote: >> While debugging DMA mapping error in chelsio crypto driver we observed that >> when scatter/gather list received by driver has some entry with page->offset >> > 4096 (PAGE_SIZE). It starts giving DMA error.  Without IOMMU it works f

Re: DMA error when sg->offset value is greater than PAGE_SIZE in Intel IOMMU

2017-09-20 Thread Harsh Jain
On 20-09-2017 15:42, Robin Murphy wrote: > On 20/09/17 09:01, Herbert Xu wrote: >> Harsh Jain wrote: >>> While debugging DMA mapping error in chelsio crypto driver we observed that >>> when scatter/gather list received by driver has some entry with >>> page->offset > 4096 (PAGE_SIZE). It start

[PATCH v4 7/6] iommu/iova: Make cached_node always valid

2017-09-20 Thread Robin Murphy
With the anchor node at the top of the rbtree, there is always a valid node for rb_next() to return, such that cached_node is only ever NULL until the first allocation. Initialising it to point at the anchor node gets rid of that window and makes the NULL checking entirely redundant. Signed-off-by

Re: [PATCH] iommu/arm-smmu-v3: Avoid ILLEGAL setting of STE.S1STALLD

2017-09-20 Thread Yisheng Xie
Hi Jean-Philippe, Thanks for reviewing. On 2017/9/19 19:43, Jean-Philippe Brucker wrote: > On 14/09/17 06:08, Yisheng Xie wrote: >> According to Spec, it is ILLEGAL to set STE.S1STALLD if STALL_MODEL >> is not 0b00, which means we should not disable stall mode if stall >> or terminate mode is not

Re: DMA error when sg->offset value is greater than PAGE_SIZE in Intel IOMMU

2017-09-20 Thread Robin Murphy
On 20/09/17 09:01, Herbert Xu wrote: > Harsh Jain wrote: >> >> While debugging DMA mapping error in chelsio crypto driver we observed that >> when scatter/gather list received by driver has some entry with page->offset >> > 4096 (PAGE_SIZE). It starts giving DMA error.  Without IOMMU it works fi

Re: [RFC] virtio-iommu version 0.4

2017-09-20 Thread Auger Eric
Hi Jean, On 19/09/2017 12:47, Jean-Philippe Brucker wrote: > Hi Eric, > > On 12/09/17 18:13, Auger Eric wrote: >> 2.6.7 >> - As I am currently integrating v0.4 in QEMU here are some other comments: >> At the moment struct virtio_iommu_req_probe flags is missing in your >> header. As such I underst

[PATCH V2 0/1] Optimise IOVA allocations for PCI devices

2017-09-20 Thread Tomasz Nowicki
Here is my test setup where I have stareted performance measurements. PCIe - TX - PCIe - | ThunderX2 |--| Intel XL710 | ---> | Intel XL710 |--| X86 | | (128 cpus) | | 40GbE | |40GbE| -

[PATCH V2 1/1] iommu/iova: Make rcache flush optional on IOVA allocation failure

2017-09-20 Thread Tomasz Nowicki
Since IOVA allocation failure is not unusual case we need to flush CPUs' rcache in hope we will succeed in next round. However, it is useful to decide whether we need rcache flush step because of two reasons: - Not scalability. On large system with ~100 CPUs iterating and flushing rcache for eac

Re: DMA error when sg->offset value is greater than PAGE_SIZE in Intel IOMMU

2017-09-20 Thread Herbert Xu
Harsh Jain wrote: > > While debugging DMA mapping error in chelsio crypto driver we observed that > when scatter/gather list received by driver has some entry with page->offset > > 4096 (PAGE_SIZE). It starts giving DMA error.  Without IOMMU it works fine. This is not a bug. The network stack