powerpc/iommu: Pass mm_struct to init/cleanup helpers

am: 2ba7ef2182

Change-Id: I1293f1efb792d15b10867749e63fcd3810fddfda
This commit is contained in:
Alexey Kardashevskiy
2017-03-22 12:05:14 +00:00
committed by android-build-merger
4 changed files with 10 additions and 9 deletions

View File

@@ -23,8 +23,8 @@ extern bool mm_iommu_preregistered(void);
extern long mm_iommu_get(unsigned long ua, unsigned long entries,
struct mm_iommu_table_group_mem_t **pmem);
extern long mm_iommu_put(struct mm_iommu_table_group_mem_t *mem);
extern void mm_iommu_init(mm_context_t *ctx);
extern void mm_iommu_cleanup(mm_context_t *ctx);
extern void mm_iommu_init(struct mm_struct *mm);
extern void mm_iommu_cleanup(struct mm_struct *mm);
extern struct mm_iommu_table_group_mem_t *mm_iommu_lookup(unsigned long ua,
unsigned long size);
extern struct mm_iommu_table_group_mem_t *mm_iommu_find(unsigned long ua,

View File

@@ -915,7 +915,7 @@ void __init setup_arch(char **cmdline_p)
init_mm.context.pte_frag = NULL;
#endif
#ifdef CONFIG_SPAPR_TCE_IOMMU
mm_iommu_init(&init_mm.context);
mm_iommu_init(&init_mm);
#endif
irqstack_early_init();
exc_lvl_early_init();

View File

@@ -115,7 +115,7 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
mm->context.pte_frag = NULL;
#endif
#ifdef CONFIG_SPAPR_TCE_IOMMU
mm_iommu_init(&mm->context);
mm_iommu_init(mm);
#endif
return 0;
}
@@ -160,7 +160,7 @@ static inline void destroy_pagetable_page(struct mm_struct *mm)
void destroy_context(struct mm_struct *mm)
{
#ifdef CONFIG_SPAPR_TCE_IOMMU
mm_iommu_cleanup(&mm->context);
mm_iommu_cleanup(mm);
#endif
#ifdef CONFIG_PPC_ICSWX

View File

@@ -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);
}