Re: [PATCH 3/5] iommu/arm-smmu: Introduce stream ID masking

2013-10-09 Thread Andreas Herrmann
On Wed, Oct 09, 2013 at 06:09:17AM -0400, Will Deacon wrote: > On Tue, Oct 08, 2013 at 07:43:50PM +0100, Rob Herring wrote: > > On 10/08/2013 11:59 AM, Will Deacon wrote: > > > On Tue, Oct 08, 2013 at 05:40:21PM +0100, Andreas Herrmann wrote: > > >> On Tue, Oct 08, 2013 at 05:20:08PM +0200, Andreas

Re: [PATCH 3/5] iommu/arm-smmu: Introduce stream ID masking

2013-10-09 Thread Andreas Herrmann
On Tue, Oct 08, 2013 at 12:59:20PM -0400, Will Deacon wrote: > On Tue, Oct 08, 2013 at 05:40:21PM +0100, Andreas Herrmann wrote: > > On Tue, Oct 08, 2013 at 05:20:08PM +0200, Andreas Herrmann wrote: > > To be more specific: For SATA I'd need to specify 10 StreamIds. This > > would > > > > (1) exce

[PATCH 7/7] iommu/arm-smmu: Introduce automatic stream-id-masking

2013-10-09 Thread Andreas Herrmann
Try to determine a mask that can be used for all StreamIDs of a master device. This allows to use just one SMR group instead of number-of-streamids SMR groups for a master device. Signed-off-by: Andreas Herrmann --- drivers/iommu/arm-smmu.c | 79 --

[PATCH 2/7] iommu/arm-smmu: Introduce bus notifier block

2013-10-09 Thread Andreas Herrmann
At the moment just handle BUS_NOTIFY_BIND_DRIVER to conditionally isolate all master devices for an SMMU. Depending on DT information each device is put into its own protection domain (if possible). For configuration with one or just a few masters per SMMU that is easy to achieve. In case of man

[PATCH 6/7] documentation/iommu: Update description of ARM System MMU binding

2013-10-09 Thread Andreas Herrmann
This patch adds descriptions fore new properties of device tree binding for the ARM SMMU architecture. These properties control arm-smmu driver options. Cc: Rob Herring Cc: Grant Likely Cc: Will Deacon Signed-off-by: Andreas Herrmann --- .../devicetree/bindings/iommu/arm,smmu.txt |

[PATCH 3/7] iommu/arm-smmu: Introduce stream ID masking

2013-10-09 Thread Andreas Herrmann
Ie. use a mask based on smr_mask_bits to map all stream IDs of an SMMU to one context. This behaviour is controlled per SMMU node with DT property "arm,smmu-mask-stream-ids" and is only allowed if just a single master is attached to an SMMU. If the option is specified, all stream-ids that are prov

[PATCH v2 0/7] iommu/arm-smmu: Misc modifications to support SMMUs on Calxeda ECX-2000

2013-10-09 Thread Andreas Herrmann
Hi, Here is v2 of arm-smmu changes to support SMMUs on Calxeda ECX-2000. Note that patch 7/7 (Introduce automatic stream-id-masking) is not required to support SMMUs on Calxeda ECX-2000. In fact the algorithm implemented won't help to determine a suitable smr-mask for 10 StreamIDs that we have fo

[PATCH 1/7] iommu/arm-smmu: Introduce driver option handling

2013-10-09 Thread Andreas Herrmann
Introduce handling of driver options. Options are set based on DT information when probing an SMMU device. The first option introduced is "arm,smmu-isolate-devices". (It will be used in the bus notifier block.) Signed-off-by: Andreas Herrmann --- drivers/iommu/arm-smmu.c | 36 +

[PATCH 4/7] iommu/arm-smmu: Support buggy implementations where all config accesses are secure

2013-10-09 Thread Andreas Herrmann
In such a case we have to use secure aliases of some non-secure registers. This handling is switched on by DT property "arm,smmu-secure-config-access" for an SMMU node. Signed-off-by: Andreas Herrmann --- drivers/iommu/arm-smmu.c | 30 +- 1 file changed, 21 inserti

[PATCH 5/7] ARM: dts: Add nodes for SMMUs on Calxeda ECX-2000

2013-10-09 Thread Andreas Herrmann
Signed-off-by: Andreas Herrmann --- arch/arm/boot/dts/ecx-2000.dts| 45 +++-- arch/arm/boot/dts/ecx-common.dtsi |9 +--- 2 files changed, 49 insertions(+), 5 deletions(-) diff --git a/arch/arm/boot/dts/ecx-2000.dts b/arch/arm/boot/dts/ecx-2000.dts in

[PATCH 1/2] iommu/fsl: Factor out PCI specific code.

2013-10-09 Thread Varun Sethi
Factor out PCI specific code in the PAMU driver. Signed-off-by: Varun Sethi --- drivers/iommu/fsl_pamu_domain.c | 81 +++ 1 file changed, 40 insertions(+), 41 deletions(-) diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c index

[PATCH 2/2] iommu/fsl: Enable default DMA window for PCIe devices once detached

2013-10-09 Thread Varun Sethi
Once the PCIe device assigned to a guest VM (via VFIO) gets detached from the iommu domain (when guest terminates), its PAMU table entry is disabled. So, this would prevent the device from being used once it's assigned back to the host. This patch allows for creation of a default DMA window corr

[GIT PULL] iommu/arm-smmu: updates for 3.13

2013-10-09 Thread Will Deacon
Hi Joerg, Please pull these ARM SMMU updates for 3.13. The bulk of the changes are from Andreas, who has been having fun running the driver on real hardware. I expect some additional patches from him in the future to add support for things like device isolation once we've ironed out the wrinkles i

Re: [PATCH 3/5] iommu/arm-smmu: Introduce stream ID masking

2013-10-09 Thread Will Deacon
On Tue, Oct 08, 2013 at 07:43:50PM +0100, Rob Herring wrote: > On 10/08/2013 11:59 AM, Will Deacon wrote: > > On Tue, Oct 08, 2013 at 05:40:21PM +0100, Andreas Herrmann wrote: > >> On Tue, Oct 08, 2013 at 05:20:08PM +0200, Andreas Herrmann wrote: > >> To be more specific: For SATA I'd need to speci

[PATCH] vfio, iommu: Fixed interaction of VFIO_IOMMU_MAP_DMA with IOMMU address limits

2013-10-09 Thread Julian Stecklina
The BUG_ON in drivers/iommu/intel-iommu.c:785 can be triggered from userspace via VFIO by calling the VFIO_IOMMU_MAP_DMA ioctl on a vfio device with any address beyond the addressing capabilities of the IOMMU. The problem is that the ioctl code calls iommu_iova_to_phys before it calls iommu_map.