linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/64: Invalidate process table caching after setting process table
@ 2017-02-27  3:32 Paul Mackerras
  2017-03-08  7:25 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Mackerras @ 2017-02-27  3:32 UTC (permalink / raw)
  To: linuxppc-dev

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 <paulus@ozlabs.org>
---
 arch/powerpc/mm/pgtable-radix.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c
index 7ac17e9..c6a9f37 100644
--- a/arch/powerpc/mm/pgtable-radix.c
+++ b/arch/powerpc/mm/pgtable-radix.c
@@ -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);
+	asm volatile("ptesync" : : : "memory");
+	asm volatile(PPC_TLBIE_5(%0,%1,2,1,1) : :
+		     "r" (TLBIEL_INVAL_SET_LPID), "r" (0));
+	asm volatile("eieio; tlbsync; ptesync" : : : "memory");
 }
 
 static void __init radix_init_partition_table(void)
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: powerpc/64: Invalidate process table caching after setting process table
  2017-02-27  3:32 [PATCH] powerpc/64: Invalidate process table caching after setting process table Paul Mackerras
@ 2017-03-08  7:25 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2017-03-08  7:25 UTC (permalink / raw)
  To: Paul Mackerras, linuxppc-dev

On Mon, 2017-02-27 at 03:32:41 UTC, Paul Mackerras wrote:
> 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 <paulus@ozlabs.org>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/7a70d7288c926ae88e0c773fbb506a

cheers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-08  7:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-27  3:32 [PATCH] powerpc/64: Invalidate process table caching after setting process table Paul Mackerras
2017-03-08  7:25 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).