powerpc/64: Invalidate process table caching after setting process table
PATCH 1/1 powerpc/64: Invalidate process table caching after setting process table
The POWER9 MMU reads and caches entries from the process table. When we kexec from one kernel to another, the second kernel sets its process table pointer but doesn't currently do anything to make the CPU invalidate any cached entries from the old process table. This adds a tlbie (TLB invalidate entry) instruction with parameters to invalidate caching of the process table after the new process table is installed.
--- arch/powerpc/mm/pgtable-radix.c | 4 ++++ 1 file changed, 4 insertions(+)
arch/powerpc/mm/pgtable-radix.c +4 -0
@@ -173,6 +173,10 @@ static void __init radix_init_pgtable(void)*/ register_process_table (__pa (process_tb),0 ,PRTB_SIZE_SHIFT -12 );pr_info ("Process table %p and radix root for kernel: %p\n" , process_tb, init_mm.pgd); + asmvolatile ("ptesync" : : :"memory" ); + asm volatile(PPC_TLBIE_5(%0,%1,2,1,1) : : + "r" (TLBIEL_INVAL_SET_LPID), "r" (0)); + asmvolatile ("eieio; tlbsync; ptesync" : : :"memory" ); }static void __init radix_init_partition_table (void )
Signature · 1 line
2.10.2
Michael Ellerman
AppliedQuoted 9 lines · Paul Mackerras
The POWER9 MMU reads and caches entries from the process table. When we kexec from one kernel to another, the second kernel sets its process table pointer but doesn't currently do anything to make the CPU invalidate any cached entries from the old process table. This adds a tlbie (TLB invalidate entry) instruction with parameters to invalidate caching of the process table after the new process table is installed.
Signed-off-by Paul Mackerras <[email protected]>
Applied to powerpc fixes, thanks.
https://git.kernel.org/powerpc/c/7a70d7288c926ae88e0c773fbb506a
cheers