diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2017-07-07 23:12:16 +0200 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-07-10 13:26:31 +0200 |
commit | 3a6a04706fd08eb5677fdfc086e26fcd5eb154f4 (patch) | |
tree | 5c8ff039b1d0c495ad084d66745e95347e4e1b98 | |
parent | powerpc/mm/radix: Properly clear process table entry (diff) | |
download | linux-3a6a04706fd08eb5677fdfc086e26fcd5eb154f4.tar.xz linux-3a6a04706fd08eb5677fdfc086e26fcd5eb154f4.zip |
powerpc/mm/radix: Synchronize updates to the process table
When writing to the process table, we need to ensure the store is
visible to a subsequent access by the MMU. We assume we never have
the PID active while doing the update, so a ptesync/isync pair
should hopefully be a big enough hammer for our purpose.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r-- | arch/powerpc/mm/mmu_context_book3s64.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/powerpc/mm/mmu_context_book3s64.c b/arch/powerpc/mm/mmu_context_book3s64.c index ceff76262c7e..abed1fe6992f 100644 --- a/arch/powerpc/mm/mmu_context_book3s64.c +++ b/arch/powerpc/mm/mmu_context_book3s64.c @@ -138,6 +138,14 @@ static int radix__init_new_context(struct mm_struct *mm) rts_field = radix__get_tree_size(); process_tb[index].prtb0 = cpu_to_be64(rts_field | __pa(mm->pgd) | RADIX_PGD_INDEX_SIZE); + /* + * Order the above store with subsequent update of the PID + * register (at which point HW can start loading/caching + * the entry) and the corresponding load by the MMU from + * the L2 cache. + */ + asm volatile("ptesync;isync" : : : "memory"); + mm->context.npu_context = NULL; return index; |