]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/mm_iommu: Allow pinning large regions
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Wed, 3 Apr 2019 04:12:33 +0000 (15:12 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 17 Apr 2019 11:36:51 +0000 (21:36 +1000)
commit633d6704a2297c6edc23dd70eaadb37934b80f1d
tree7aac3da0f61a6d20c362b9dda93bdcb1d0be833f
parentfc56d05e5225cf76096d371ac0503b54a6be9d7c
powerpc/mm_iommu: Allow pinning large regions

When called with vmas_arg==NULL, get_user_pages_longterm() allocates
an array of nr_pages*8 which can easily get greater that the max order,
for example, registering memory for a 256GB guest does this and fails
in __alloc_pages_nodemask().

This adds a loop over chunks of entries to fit the max order limit.

Fixes: b3acf3095246 ("powerpc/mm/iommu: allow migration of cma allocated pages during mm_iommu_do_alloc", 2019-03-05)
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/mm/mmu_context_iommu.c