All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: Only do ERAT invalidate on radix context switch on P9 DD1
@ 2017-06-25 20:08 Benjamin Herrenschmidt
  2017-06-29 12:21 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2017-06-25 20:08 UTC (permalink / raw)
  To: linuxppc dev list; +Cc: Michael Neuling

From: Michael Neuling <mikey@neuling.org>

On P9 (Nimbus) DD2 and later, in radix mode, the move to the PID
register will implicitly invalidate the user space ERAT entries
and leave the kernel ones alone. Thus the only thing needed is
an isync() to synchronize this with subsequent uaccess's 

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

diff --git a/arch/powerpc/mm/mmu_context_book3s64.c b/arch/powerpc/mm/mmu_context_book3s64.c
index a3edf813d4..71de2c6d88 100644
--- a/arch/powerpc/mm/mmu_context_book3s64.c
+++ b/arch/powerpc/mm/mmu_context_book3s64.c
@@ -235,10 +235,15 @@ void destroy_context(struct mm_struct *mm)
 #ifdef CONFIG_PPC_RADIX_MMU
 void radix__switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
 {
-	asm volatile("isync": : :"memory");
-	mtspr(SPRN_PID, next->context.id);
-	asm volatile("isync \n"
-		     PPC_SLBIA(0x7)
-		     : : :"memory");
+
+	if (cpu_has_feature(CPU_FTR_POWER9_DD1)) {
+		isync();
+		mtspr(SPRN_PID, next->context.id);
+		isync();
+		asm volatile(PPC_INVALIDATE_ERAT : : :"memory");
+	} else {
+		mtspr(SPRN_PID, next->context.id);
+		isync();
+	}
 }
 #endif

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

* Re: powerpc: Only do ERAT invalidate on radix context switch on P9 DD1
  2017-06-25 20:08 [PATCH] powerpc: Only do ERAT invalidate on radix context switch on P9 DD1 Benjamin Herrenschmidt
@ 2017-06-29 12:21 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2017-06-29 12:21 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc dev list; +Cc: Michael Neuling

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 602 bytes --]

On Sun, 2017-06-25 at 20:08:46 UTC, Benjamin Herrenschmidt wrote:
> From: Michael Neuling <mikey@neuling.org>
> 
> On P9 (Nimbus) DD2 and later, in radix mode, the move to the PID
> register will implicitly invalidate the user space ERAT entries
> and leave the kernel ones alone. Thus the only thing needed is
> an isync() to synchronize this with subsequent uaccess's 
> 
> Signed-off-by: Michael Neuling <mikey@neuling.org>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/74e27c6af56fe6898c3c8c45159574

cheers

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

end of thread, other threads:[~2017-06-29 12:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-25 20:08 [PATCH] powerpc: Only do ERAT invalidate on radix context switch on P9 DD1 Benjamin Herrenschmidt
2017-06-29 12:21 ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.