OSDN Git Service

iommu/amd: Reserve exclusion range in iova-domain
authorJoerg Roedel <jroedel@suse.de>
Thu, 28 Mar 2019 10:44:59 +0000 (11:44 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 4 May 2019 07:20:22 +0000 (09:20 +0200)
commit71f3397a1c311c7aad7d141871c5b3404d18b6d0
tree1326a9addb8cae8e4c395ca4e5ad993d8b404c08
parent75a5e3e6340cc07c1f87dcd7b82596a308c7e9fb
iommu/amd: Reserve exclusion range in iova-domain

[ Upstream commit 8aafaaf2212192012f5bae305bb31cdf7681d777 ]

If a device has an exclusion range specified in the IVRS
table, this region needs to be reserved in the iova-domain
of that device. This hasn't happened until now and can cause
data corruption on data transfered with these devices.

Treat exclusion ranges as reserved regions in the iommu-core
to fix the problem.

Fixes: be2a022c0dd0 ('x86, AMD IOMMU: add functions to parse IOMMU memory mapping requirements for devices')
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Reviewed-by: Gary R Hook <gary.hook@amd.com>
Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
drivers/iommu/amd_iommu.c
drivers/iommu/amd_iommu_init.c
drivers/iommu/amd_iommu_types.h