summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt2017-07-08 14:45:32 +0200
committerMichael Ellerman2017-07-10 13:24:34 +0200
commitc6bb0b8d426a8cf865ca9c8a532cc3a2927cfceb (patch)
treeb147167c3c0635c5fbb395f665a006b7f5bce0f1 /arch/powerpc/mm
parentpowerpc/powernv: Tell OPAL about our MMU mode on POWER9 (diff)
downloadkernel-qcow2-linux-c6bb0b8d426a8cf865ca9c8a532cc3a2927cfceb.tar.gz
kernel-qcow2-linux-c6bb0b8d426a8cf865ca9c8a532cc3a2927cfceb.tar.xz
kernel-qcow2-linux-c6bb0b8d426a8cf865ca9c8a532cc3a2927cfceb.zip
powerpc/mm/radix: Properly clear process table entry
On radix, the process table entry we want to clear when destroying a context is entry 0, not entry 1. This has no *immediate* consequence on Power9, but it can cause other bugs to become worse. Fixes: 7e381c0ff618 ("powerpc/mm/radix: Add mmu context handling callback for radix") Cc: stable@vger.kernel.org # v4.7+ Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r--arch/powerpc/mm/mmu_context_book3s64.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/powerpc/mm/mmu_context_book3s64.c b/arch/powerpc/mm/mmu_context_book3s64.c
index 71de2c6d88f3..ceff76262c7e 100644
--- a/arch/powerpc/mm/mmu_context_book3s64.c
+++ b/arch/powerpc/mm/mmu_context_book3s64.c
@@ -223,9 +223,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);