]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iommu/tegra-smmu: Fix page tables in > 4 GiB memory
authorThierry Reding <treding@nvidia.com>
Wed, 16 Oct 2019 11:50:26 +0000 (13:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 4 Jan 2020 12:40:37 +0000 (13:40 +0100)
commite5fb4e72dbfaf0d0f0a3561a5cb7d57b8774d366
treef0ba8cc2a6b763dd1bc5edd26bcb39a93d0951dd
parentd1eafbbbe075bbf80b04c870481014a9ffdd75f1
iommu/tegra-smmu: Fix page tables in > 4 GiB memory

[ Upstream commit 96d3ab802e4930a29a33934373157d6dff1b2c7e ]

Page tables that reside in physical memory beyond the 4 GiB boundary are
currently not working properly. The reason is that when the physical
address for page directory entries is read, it gets truncated at 32 bits
and can cause crashes when passing that address to the DMA API.

Fix this by first casting the PDE value to a dma_addr_t and then using
the page frame number mask for the SMMU instance to mask out the invalid
bits, which are typically used for mapping attributes, etc.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/tegra-smmu.c