powerpc/pseries/iommu: Allow DDW windows starting at 0x00
authorLeonardo Bras <leobras.c@gmail.com>
Tue, 17 Aug 2021 06:39:23 +0000 (03:39 -0300)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 26 Aug 2021 14:56:55 +0000 (00:56 +1000)
commit2ca73c54ce24489518a56d816331b774044c2445
treee034fd023d6bd28f2a001bf24d5fda9b95d84bd2
parent92a23219299cedde52e3298788484f4875d5ce0f
powerpc/pseries/iommu: Allow DDW windows starting at 0x00

enable_ddw() currently returns the address of the DMA window, which is
considered invalid if has the value 0x00.

Also, it only considers valid an address returned from find_existing_ddw
if it's not 0x00.

Changing this behavior makes sense, given the users of enable_ddw() only
need to know if direct mapping is possible. It can also allow a DMA window
starting at 0x00 to be used.

This will be helpful for using a DDW with indirect mapping, as the window
address will be different than 0x00, but it will not map the whole
partition.

Signed-off-by: Leonardo Bras <leobras.c@gmail.com>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Frederic Barrat <fbarrat@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210817063929.38701-6-leobras.c@gmail.com
arch/powerpc/platforms/pseries/iommu.c