]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iommu/io-pgtable-arm: Fix stage-2 concatenation with 16K
authorMostafa Saleh <smostafa@google.com>
Mon, 2 Dec 2024 14:06:03 +0000 (14:06 +0000)
committerWill Deacon <will@kernel.org>
Mon, 9 Dec 2024 23:53:18 +0000 (23:53 +0000)
commit4dcac8407fe1be21990f356e2e8d8309ba63e346
treec457adbfc316aa06ad49dc96c253f2e06c123cc0
parentcdfb9840fcc60b6e493aec077b1eecaa3268640b
iommu/io-pgtable-arm: Fix stage-2 concatenation with 16K

At the moment, io-pgtable-arm uses concatenation only if it is
possible at level 0, which misses a case where concatenation is
mandatory at level 1 according to R_SRKBC in Arm spec DDI0487 K.a.

Also, that means concatenation can be used when not mandated,
contradicting the comment on the code. However, these cases can only
happen if the SMMUv3 driver is changed to use ias != oas for stage-2.

This patch re-writes the code to use concatenation only if mandatory,
fixing the missing case for level-1 and granule 16K with PA = 40 bits.

Signed-off-by: Mostafa Saleh <smostafa@google.com>
Link: https://lore.kernel.org/r/20241202140604.422235-2-smostafa@google.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/io-pgtable-arm.c