]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/arm-smmu: Fix stream-match conflict with IOMMU_DOMAIN_DMA
authorWill Deacon <will.deacon@arm.com>
Wed, 20 Apr 2016 13:53:32 +0000 (14:53 +0100)
committerJoerg Roedel <jroedel@suse.de>
Thu, 21 Apr 2016 14:47:32 +0000 (16:47 +0200)
commit21802dcaba1f7f30521d4b4f30801b6862e7e057
tree7464458fbf8fb11cc5d866df61d4ac7415a46491
parenta3b51e0c6449701397f4a977b0cf4f64af9635c2
iommu/arm-smmu: Fix stream-match conflict with IOMMU_DOMAIN_DMA

Commit 3365991022f6 ("iommu/arm-smmu: Treat IOMMU_DOMAIN_DMA as bypass
for now") ignores requests to attach a device to the default domain
since, without IOMMU-basked DMA ops available everywhere, the default
domain will just lead to unexpected transaction faults being reported.

Unfortunately, the way this was implemented on SMMUv2 causes a
regression with VFIO PCI device passthrough under KVM on AMD Seattle.
On this system, the host controller device is associated with both a
pci_dev *and* a platform_device, and can therefore end up with duplicate
SMR entries, resulting in a stream-match conflict at runtime.

This patch amends the original fix so that attaching to IOMMU_DOMAIN_DMA
is rejected even before configuring the SMRs. This restores the old
behaviour for now, but we'll need to look at handing host controllers
specially when we come to supporting the default domain fully.

Reported-by: Eric Auger <eric.auger@linaro.org>
Tested-by: Eric Auger <eric.auger@linaro.org>
Tested-by: Yang Shi <yang.shi@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/arm-smmu.c