OSDN Git Service

iommu/amd: Init unity mappings only for dma_ops domains
authorJoerg Roedel <jroedel@suse.de>
Wed, 13 Jul 2016 10:35:24 +0000 (12:35 +0200)
committerJoerg Roedel <jroedel@suse.de>
Wed, 13 Jul 2016 10:35:24 +0000 (12:35 +0200)
commitb548e786ce47017107765bbeb0f100202525ea83
tree158fae78345a2ad96536115fe4929eee425f34e4
parentcf7513e759d19908c29cf2c129587ecda34a5c19
iommu/amd: Init unity mappings only for dma_ops domains

The default domain for a device might also be
identity-mapped. In this case the kernel would crash when
unity mappings are defined for the device. Fix that by
making sure the domain is a dma_ops domain.

Fixes: 0bb6e243d7fb ('iommu/amd: Support IOMMU_DOMAIN_DMA type allocation')
Cc: stable@vger.kernel.org # v4.2+
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd_iommu.c