powerpc/iommu: Stop using @current in mm_iommu_xxx
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Fri, 17 Mar 2017 00:48:27 +0000 (00:48 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Mar 2017 11:43:37 +0000 (12:43 +0100)
commit5b34666bd2e70046f9880db01119c7d908e0888d
tree47e3102213d5ccd30647bad1102dbfcdc8556680
parent2ba7ef21820ec5cb2376078774e24d6f6a7386b2
powerpc/iommu: Stop using @current in mm_iommu_xxx

[ Upstream commit d7baee6901b34c4895eb78efdbf13a49079d7404 ]

This changes mm_iommu_xxx helpers to take mm_struct as a parameter
instead of getting it from @current which in some situations may
not have a valid reference to mm.

This changes helpers to receive @mm and moves all references to @current
to the caller, including checks for !current and !current->mm;
checks in mm_iommu_preregistered() are removed as there is no caller
yet.

This moves the mm_iommu_adjust_locked_vm() call to the caller as
it receives mm_iommu_table_group_mem_t but it needs mm.

This should cause no behavioral change.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/include/asm/mmu_context.h
arch/powerpc/mm/mmu_context_iommu.c
drivers/vfio/vfio_iommu_spapr_tce.c