Thread (7 messages) flat view 7 messages, 5 authors, 2017-07-11

Re: [PATCH 1/2] powerpc/mm/radix: Properly clear process table entry

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2017-07-10 03:51:55

Benjamin Herrenschmidt [off-list ref] writes:
On radix, the process table entry we want to clear when
destroying a context is entry 0, not entry 1
.. but has no real world consequence? Or causes the system to instantly
catch fire?


I'll tag it:

Fixes: 7e381c0ff618 ("powerpc/mm/radix: Add mmu context handling callback for radix")

cheers
quoted hunk ↗ jump to hunk
diff --git a/arch/powerpc/mm/mmu_context_book3s64.c b/arch/powerpc/mm/mmu_context_book3s64.c
index 79d8c8a..9404b5e 100644
--- a/arch/powerpc/mm/mmu_context_book3s64.c
+++ b/arch/powerpc/mm/mmu_context_book3s64.c
@@ -226,9 +226,15 @@ void destroy_context(struct mm_struct *mm)
 	mm->context.cop_lockp = NULL;
 #endif /* CONFIG_PPC_ICSWX */
 
-	if (radix_enabled())
-		process_tb[mm->context.id].prtb1 = 0;
-	else
+	if (radix_enabled()) {
+		/*
+		 * Radix doesn't have a valid bit in the process table
+		 * entries. However we know that at least P9 implementation
+		 * will avoid caching an entry with an invalid RTS field,
+		 * and 0 is invalid. So this will do.
+		 */
+		process_tb[mm->context.id].prtb0 = 0;
+	} else
 		subpage_prot_free(mm);
 	destroy_pagetable_page(mm);
 	__destroy_context(mm->context.id);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help