summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/mmu_context_iommu.c
diff options
context:
space:
mode:
authorAlexey Kardashevskiy2016-11-30 07:51:59 +0100
committerMichael Ellerman2016-12-02 04:38:27 +0100
commit88f54a3581eb9deaa3bd1aade40aef266d782385 (patch)
tree0881b300b6c4876e07faceebc1706feea78e47c9 /arch/powerpc/mm/mmu_context_iommu.c
parentpowerpc/64: Define ILLEGAL_POINTER_VALUE for 64-bit (diff)
downloadkernel-qcow2-linux-88f54a3581eb9deaa3bd1aade40aef266d782385.tar.gz
kernel-qcow2-linux-88f54a3581eb9deaa3bd1aade40aef266d782385.tar.xz
kernel-qcow2-linux-88f54a3581eb9deaa3bd1aade40aef266d782385.zip
powerpc/iommu: Pass mm_struct to init/cleanup helpers
We are going to get rid of @current references in mmu_context_boos3s64.c and cache mm_struct in the VFIO container. Since mm_context_t does not have reference counting, we will be using mm_struct which does have the reference counter. This changes mm_iommu_init/mm_iommu_cleanup to receive mm_struct rather than mm_context_t (which is embedded into mm). This should not cause any behavioral change. 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>
Diffstat (limited to 'arch/powerpc/mm/mmu_context_iommu.c')
-rw-r--r--arch/powerpc/mm/mmu_context_iommu.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/powerpc/mm/mmu_context_iommu.c b/arch/powerpc/mm/mmu_context_iommu.c
index e0f1c33601dd..ad2e575fd418 100644
--- a/arch/powerpc/mm/mmu_context_iommu.c
+++ b/arch/powerpc/mm/mmu_context_iommu.c
@@ -373,16 +373,17 @@ void mm_iommu_mapped_dec(struct mm_iommu_table_group_mem_t *mem)
}
EXPORT_SYMBOL_GPL(mm_iommu_mapped_dec);
-void mm_iommu_init(mm_context_t *ctx)
+void mm_iommu_init(struct mm_struct *mm)
{
- INIT_LIST_HEAD_RCU(&ctx->iommu_group_mem_list);
+ INIT_LIST_HEAD_RCU(&mm->context.iommu_group_mem_list);
}
-void mm_iommu_cleanup(mm_context_t *ctx)
+void mm_iommu_cleanup(struct mm_struct *mm)
{
struct mm_iommu_table_group_mem_t *mem, *tmp;
- list_for_each_entry_safe(mem, tmp, &ctx->iommu_group_mem_list, next) {
+ list_for_each_entry_safe(mem, tmp, &mm->context.iommu_group_mem_list,
+ next) {
list_del_rcu(&mem->next);
mm_iommu_do_free(mem);
}