iommu/io-pgtable-arm: Fix table descriptor paddr formatting
authorHector Martin <marcan@marcan.st>
Sat, 20 Nov 2021 03:13:43 +0000 (12:13 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 09:54:06 +0000 (10:54 +0100)
commited43b2e048fec0d206734d46e294cdcf84f6b339
tree962b2057fcf3a25cef608c969efaafde7e0346b6
parente9e4d1fb4590956add5cc4cd01b6d471f4475489
iommu/io-pgtable-arm: Fix table descriptor paddr formatting

[ Upstream commit 9abe2ac834851a7d0b0756e295cf7a292c45ca53 ]

Table descriptors were being installed without properly formatting the
address using paddr_to_iopte, which does not match up with the
iopte_deref in __arm_lpae_map. This is incorrect for the LPAE pte
format, as it does not handle the high bits properly.

This was found on Apple T6000 DARTs, which require a new pte format
(different shift); adding support for that to
paddr_to_iopte/iopte_to_paddr caused it to break badly, as even <48-bit
addresses would end up incorrect in that case.

Fixes: 6c89928ff7a0 ("iommu/io-pgtable-arm: Support 52-bit physical address")
Acked-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Hector Martin <marcan@marcan.st>
Link: https://lore.kernel.org/r/20211120031343.88034-1-marcan@marcan.st
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/io-pgtable-arm.c