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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Aug 2016 16:09:21 +0000 (18:09 +0200)
commitdf8eaed22590a484a64e4a6f2af266f59a692aed
tree496a4b09801ffc7fee7a56aa3937d4e2075fdffc
parent51e94ff8d90804ec1912fd71b2c7e22902a61585
iommu/amd: Init unity mappings only for dma_ops domains

commit b548e786ce47017107765bbeb0f100202525ea83 upstream.

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')
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iommu/amd_iommu.c