MLK-15007-1 iommu: arm: pgtable: alloc pagetable in DMA area
authorPeng Fan <peng.fan@nxp.com>
Tue, 15 Jan 2019 05:43:02 +0000 (11:13 +0530)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
commit90d512cf0abbcc1550bcbdc36f6bebc7c71aa141
treef84b854f5c378183e605ece58a60b934da1317c4
parent992c96c75601a88bcfaf1256ac2810b91034359b
MLK-15007-1 iommu: arm: pgtable: alloc pagetable in DMA area

Normally the iommu pagetable could be in 64bit address space,
but we have one patch to address PCIE driver, 'commit 9e03e5076269
("MLK-15064-2 ARM64: DMA: limit the dma mask to be 32bit")'

The patch restrict swiotlb and iommu dma to be in 32bit address.

So if we allocate pages in highmem, then dma_map_single will return
a 32bit address. Then, we will get "Cannot accommodate DMA
translation for IOMMU page tables", because `dma != virt_to_phys(pages)`.

So we strict the lpae iommu pgtable in DMA area to fix this issue.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Vipul: while rebase on v4.19, apply manually and use
commit 4b123757eeaa iommu/io-pgtable-arm: Make allocations NUMA-aware
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
drivers/iommu/io-pgtable-arm.c