]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/mmu: Add real mode support for IOMMU preregistered memory
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Wed, 22 Mar 2017 04:21:47 +0000 (15:21 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 27 Mar 2017 04:25:48 +0000 (15:25 +1100)
commit7a695fa640515ecbaa865816e254b09d5ec5ece2
treef339cf0557fee4d263442469108303f796080ba7
parent934778e31a56dfe7dd1b2bbcd6063538c354fb9e
powerpc/mmu: Add real mode support for IOMMU preregistered memory

This makes mm_iommu_lookup() able to work in realmode by replacing
list_for_each_entry_rcu() (which can do debug stuff which can fail in
real mode) with list_for_each_entry_lockless().

This adds realmode version of mm_iommu_ua_to_hpa() which adds
explicit vmalloc'd-to-linear address conversion.
Unlike mm_iommu_ua_to_hpa(), mm_iommu_ua_to_hpa_rm() can fail.

This changes mm_iommu_preregistered() to receive @mm as in real mode
@current does not always have a correct pointer.

This adds realmode version of mm_iommu_lookup() which receives @mm
(for the same reason as for mm_iommu_preregistered()) and uses
lockless version of list_for_each_entry_rcu().

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/mmu_context.h
arch/powerpc/mm/mmu_context_iommu.c