Re: [PATCH v8 01/18] iommu/dma: Allow MSI-only cookies

2017-01-17 Thread Tomasz Nowicki
On 11.01.2017 10:41, Eric Auger wrote: From: Robin Murphy IOMMU domain users such as VFIO face a similar problem to DMA API ops with regard to mapping MSI messages in systems where the MSI write is subject to IOMMU translation. With the relevant infrastructure now in place for managed DMA domai

Re: [PATCH v8 02/18] iommu: Rename iommu_dm_regions into iommu_resv_regions

2017-01-17 Thread Tomasz Nowicki
On 11.01.2017 10:41, Eric Auger wrote: We want to extend the callbacks used for dm regions and use them for reserved regions. Reserved regions can be - directly mapped regions - regions that cannot be iommu mapped (PCI host bridge windows, ...) - MSI regions (because they belong to another addres

Re: [PATCH v8 04/18] iommu: iommu_alloc_resv_region

2017-01-17 Thread Tomasz Nowicki
On 11.01.2017 10:41, Eric Auger wrote: Introduce a new helper serving the purpose to allocate a reserved region. This will be used in iommu driver implementing reserved region callbacks. Signed-off-by: Eric Auger Reviewed-by: Tomasz Nowicki Thanks, Tomasz --- v3 -> v4: - add INIT_LIST_H

Re: [PATCH v8 05/18] iommu: Only map direct mapped regions

2017-01-17 Thread Tomasz Nowicki
On 11.01.2017 10:41, Eric Auger wrote: As we introduced new reserved region types which do not require mapping, let's make sure we only map direct mapped regions. Signed-off-by: Eric Auger Reviewed-by: Tomasz Nowicki Thanks, Tomasz --- v3 -> v4: - use region's type and reword commit mes

Re: [PATCH v8 06/18] iommu: iommu_get_group_resv_regions

2017-01-17 Thread Tomasz Nowicki
On 11.01.2017 10:41, Eric Auger wrote: Introduce iommu_get_group_resv_regions whose role consists in enumerating all devices from the group and collecting their reserved regions. The list is sorted and overlaps between regions of the same type are handled by merging the regions. Signed-off-by: E

Re: [PATCH v8 10/18] iommu/arm-smmu: Implement reserved region get/put callbacks

2017-01-17 Thread Tomasz Nowicki
On 11.01.2017 10:41, Eric Auger wrote: The get() populates the list with the MSI IOVA reserved window. At the moment an arbitray MSI IOVA window is set at 0x800 of size 1MB. This will allow to report those info in iommu-group sysfs. Signed-off-by: Eric Auger Reviewed-by: Tomasz Nowicki

Re: [PATCH v8 14/18] irqdomain: irq_domain_check_msi_remap

2017-01-17 Thread Tomasz Nowicki
On 11.01.2017 10:41, Eric Auger wrote: This new function checks whether all MSI irq domains implement IRQ remapping. This is useful to understand whether VFIO passthrough is safe with respect to interrupts. On ARM typically an MSI controller can sit downstream to the IOMMU without preventing VFI

Re: [PATCH v8 14/18] irqdomain: irq_domain_check_msi_remap

2017-01-17 Thread Auger Eric
Hi Tomasz, On 17/01/2017 14:40, Tomasz Nowicki wrote: > On 11.01.2017 10:41, Eric Auger wrote: >> This new function checks whether all MSI irq domains >> implement IRQ remapping. This is useful to understand >> whether VFIO passthrough is safe with respect to interrupts. >> >> On ARM typically an

Re: [PATCH v8 14/18] irqdomain: irq_domain_check_msi_remap

2017-01-17 Thread Tomasz Nowicki
On 17.01.2017 14:53, Auger Eric wrote: Hi Tomasz, On 17/01/2017 14:40, Tomasz Nowicki wrote: On 11.01.2017 10:41, Eric Auger wrote: This new function checks whether all MSI irq domains implement IRQ remapping. This is useful to understand whether VFIO passthrough is safe with respect to interr

Re: [PATCH v8 11/18] iommu/arm-smmu-v3: Implement reserved region get/put callbacks

2017-01-17 Thread Tomasz Nowicki
On 11.01.2017 10:41, Eric Auger wrote: iommu/arm-smmu: Implement reserved region get/put callbacks The get() populates the list with the MSI IOVA reserved window. At the moment an arbitray MSI IOVA window is set at 0x800 of size 1MB. This will allow to report those info in iommu-group sysfs

[PATCH v3] IOMMU: SMMUv2: Support for Extended Stream ID (16 bit)

2017-01-17 Thread Aleksey Makarov
Enable the Extended Stream ID feature when available. This patch on top of series "KVM PCIe/MSI passthrough on ARM/ARM64 and IOVA reserved regions" by Eric Auger [1] allows to passthrough an external PCIe network card on a ThunderX server successfully. Without this patch that card caused a warnin

Re: [PATCH v8 0/9] perf/amd/iommu: Enable multi-IOMMU support

2017-01-17 Thread Joerg Roedel
On Mon, Jan 16, 2017 at 01:23:27AM -0600, Suthikulpanit, Suravee wrote: > Suravee Suthikulpanit (9): > perf/amd/iommu: Declare pr_fmt and remove unnecessary pr_debug > perf/amd/iommu: Clean up perf_iommu_enable_event > perf/amd/iommu: Misc fix up perf_iommu_read > iommu/amd: Introduce amd_i

Re: [PATCH] iommu: Handle default domain attach failure

2017-01-17 Thread Joerg Roedel
On Mon, Jan 16, 2017 at 12:58:07PM +, Robin Murphy wrote: > We wouldn't normally expect ops->attach_dev() to fail, but on IOMMUs > with limited hardware resources, or generally misconfigured systems, > it is certainly possible. We report failure correctly from the external > iommu_attach_device