OSDN Git Service

powerpc/pseries/ddw: Extend upper limit for huge DMA window for persistent memory
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Tue, 31 Mar 2020 01:23:38 +0000 (12:23 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 3 Apr 2020 01:22:47 +0000 (12:22 +1100)
commit54fc3c681ded9437e4548e2501dc1136b23cfa9a
tree5f143ff06e2303a38f1d7ededea4921135d07d79
parent7c0eda1a04340a1de09bdf6521853e3bc0637c3b
powerpc/pseries/ddw: Extend upper limit for huge DMA window for persistent memory

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.

Since the persistent memory is still backed with page structs, use
MAX_PHYSMEM_BITS as the upper limit.

This effectively disables huge DMA window in LPAR under pHyp if
persistent memory is present but this is the best we can do for the
moment.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Tested-by: Wen Xiong<wenxiong@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200331012338.23773-1-aik@ozlabs.ru
arch/powerpc/platforms/pseries/iommu.c