powerpc/mm: Add support for handling > 512TB address in SLB miss
[linux-2.6-block.git] / arch / powerpc / mm / mmu_context_book3s64.c
index 422be81bf69f360119da306b6a8d08434dcf26ba..b75194dff64c28a836876facdd1b9962fdaefd7a 100644 (file)
@@ -179,6 +179,19 @@ void __destroy_context(int context_id)
 }
 EXPORT_SYMBOL_GPL(__destroy_context);
 
+static void destroy_contexts(mm_context_t *ctx)
+{
+       int index, context_id;
+
+       spin_lock(&mmu_context_lock);
+       for (index = 0; index < ARRAY_SIZE(ctx->extended_id); index++) {
+               context_id = ctx->extended_id[index];
+               if (context_id)
+                       ida_remove(&mmu_context_ida, context_id);
+       }
+       spin_unlock(&mmu_context_lock);
+}
+
 #ifdef CONFIG_PPC_64K_PAGES
 static void destroy_pagetable_page(struct mm_struct *mm)
 {
@@ -217,7 +230,7 @@ void destroy_context(struct mm_struct *mm)
        else
                subpage_prot_free(mm);
        destroy_pagetable_page(mm);
-       __destroy_context(mm->context.id);
+       destroy_contexts(&mm->context);
        mm->context.id = MMU_NO_CONTEXT;
 }