Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
powerpc/dma: Call indirect dma_ops when persistent memory present
Unlike normal memory ("memory" compatible type in the FDT), the persistent memory ("ibm,pmemory" in the FDT) can be mapped anywhere in the guest physical space and it can be used for DMA. In order to maintain 1:1 mapping via the huge DMA window, we need to know the maximum physical address at the time of the window setup. So far we've been looking at "memory" nodes but "ibm,pmemory" does not have fixed addresses and the persistent memory may be mapped afterwards. When persistent memory present, this clears the dma_ops_bypass flag to tell the generic code that indirect dma_ops call is needed. This lets the platform code check the DMA boundaries and call direct DMA if possible or IOMMU API otherwise. If dma_ops_bypass is not set, this goes to IOMMU DMA unconditionally as we cannot easily predict where the memory for DMA is going to be allocated from (can be ibm,pmemory as well). This limits IOMMU bypass by max_pfn so this affects powernv as well. This should not change the existing behaviour in absence of persistent memory. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> --- This is based on http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/dma-bypass.3
- Loading branch information