aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2017-06-24 14:17:25 -0500
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-06-26 14:28:58 +1000
commitb137ad45d298644a3c34047b2072b74bc7ec9c26 (patch)
tree958f611f5d812069204bb010750b7b6d99af453e
parent2c44b08555be662bc993401412317db253385d4a (diff)
downloadskiboot-b137ad45d298644a3c34047b2072b74bc7ec9c26.zip
skiboot-b137ad45d298644a3c34047b2072b74bc7ec9c26.tar.gz
skiboot-b137ad45d298644a3c34047b2072b74bc7ec9c26.tar.bz2
Add "cleanup_global_tlb" for P9 and later
Uses broadcast TLBIE's to cleanup the TLB on all cores and on the nest MMU By default this works with older binutils but there is a version (in #defines) that requires newer binutils and which documents what the instructions are. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--asm/misc.S60
-rw-r--r--include/skiboot.h1
2 files changed, 61 insertions, 0 deletions
diff --git a/asm/misc.S b/asm/misc.S
index 4c9eee9..381590b 100644
--- a/asm/misc.S
+++ b/asm/misc.S
@@ -19,6 +19,8 @@
#include <processor.h>
#include <stack.h>
+#define OLD_BINUTILS 1
+
.section ".text","ax"
.balign 0x10
@@ -63,3 +65,61 @@ cleanup_local_tlb:
bdnz 1b
ptesync
blr
+
+ .global cleanup_global_tlb
+cleanup_global_tlb:
+
+ /* Only supported on P9 for now */
+ mfspr %r3,SPR_PVR
+ srdi %r3,%r3,16
+ cmpwi cr0,%r3,PVR_TYPE_P9
+ bnelr
+
+ /* Sync out previous updates */
+ ptesync
+
+#ifndef OLD_BINUTILS
+ .machine "power9"
+#endif
+ /* Lead RB with IS=11 */
+ li %r3,3
+ sldi %r3,%r3,10
+ li %r0,0
+
+ /* Blow up radix partition scoped translations */
+#ifdef OLD_BINUTILS
+ .long 0x7c0b1a64
+#else
+ tlbie %r3, %r0 /* rs */, 2 /* ric */, 1 /* prs */, 1 /* r */
+#endif
+ eieio
+ tlbsync
+ ptesync
+#ifdef OLD_BINUTILS
+ .long 0x7c091a64
+#else
+ tlbie %r3, %r0 /* rs */, 2 /* ric */, 0 /* prs */, 1 /* r */
+#endif
+ eieio
+ tlbsync
+ ptesync
+
+ /* Blow up hash partition scoped translations */
+#ifdef OLD_BINUTILS
+ .long 0x7c0a1a64
+#else
+ tlbie %r3, %r0 /* rs */, 2 /* ric */, 1 /* prs */, 0 /* r */
+#endif
+ eieio
+ tlbsync
+ ptesync
+#ifdef OLD_BINUTILS
+ .long 0x7c081a64
+#else
+ tlbie %r3, %r0 /* rs */, 2 /* ric */, 0 /* prs */, 0 /* r */
+#endif
+ eieio
+ tlbsync
+ ptesync
+
+ blr
diff --git a/include/skiboot.h b/include/skiboot.h
index 87d8503..1a153b0 100644
--- a/include/skiboot.h
+++ b/include/skiboot.h
@@ -204,6 +204,7 @@ extern void fast_reboot(void);
extern void __noreturn __secondary_cpu_entry(void);
extern void __noreturn load_and_boot_kernel(bool is_reboot);
extern void cleanup_local_tlb(void);
+extern void cleanup_global_tlb(void);
extern void init_shared_sprs(void);
extern void init_replicated_sprs(void);
extern bool start_preload_kernel(void);