[Skiboot] [PATCH 13/16] asm/head: sreset handler remove FIXUP_ENDIAN

Nicholas Piggin npiggin at gmail.com
Tue Jan 8 01:04:25 AEDT 2019


Remove FIXUP_ENDIAN from the normal sreset handler (not the fast
reboot handler), to prevent it from trashing registers and CFAR.

This mean sreset can be used to report a reliable register dump,
and even be recoverable. A watchdog could be implemented to
catch and diagnose stuck CPUs during boot using sreset.

Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
---
 asm/head.S          | 15 ---------------
 include/asm-utils.h | 12 ++++++++++++
 2 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/asm/head.S b/asm/head.S
index e9d9d9998..0f2eccc39 100644
--- a/asm/head.S
+++ b/asm/head.S
@@ -534,19 +534,6 @@ call_relocate:
 1:	/* Fatal relocate failure */
 	attn
 
-#define FIXUP_ENDIAN						   \
-	tdi   0,0,0x48;	  /* Reverse endian of b . + 8		*/ \
-	b     191f;	  /* Skip trampoline if endian is good	*/ \
-	.long 0xa600607d; /* mfmsr r11				*/ \
-	.long 0x01006b69; /* xori r11,r11,1			*/ \
-	.long 0x05009f42; /* bcl 20,31,$+4			*/ \
-	.long 0xa602487d; /* mflr r10				*/ \
-	.long 0x14004a39; /* addi r10,r10,20			*/ \
-	.long 0xa64b5a7d; /* mthsrr0 r10			*/ \
-	.long 0xa64b7b7d; /* mthsrr1 r11			*/ \
-	.long 0x2402004c; /* hrfid				*/ \
-191:
-
 .global enable_machine_check
 enable_machine_check:
 	mflr	%r0
@@ -679,8 +666,6 @@ enter_p9_pm_state:
  */
 .global reset_patch_start
 reset_patch_start:
-	FIXUP_ENDIAN
-	smt_medium
 	LOAD_IMM64(%r30, SKIBOOT_BASE)
 	LOAD_IMM32(%r3, reset_wakeup - __head)
 	add	%r3,%r30,%r3
diff --git a/include/asm-utils.h b/include/asm-utils.h
index 503f2cccc..e94a14326 100644
--- a/include/asm-utils.h
+++ b/include/asm-utils.h
@@ -41,5 +41,17 @@
 /* Load an address via the TOC */
 #define LOAD_ADDR_FROM_TOC(r, e)	ld r,e at got(%r2)
 
+#define FIXUP_ENDIAN						   \
+	tdi   0,0,0x48;	  /* Reverse endian of b . + 8		*/ \
+	b     191f;	  /* Skip trampoline if endian is good	*/ \
+	.long 0xa600607d; /* mfmsr r11				*/ \
+	.long 0x01006b69; /* xori r11,r11,1			*/ \
+	.long 0x05009f42; /* bcl 20,31,$+4			*/ \
+	.long 0xa602487d; /* mflr r10				*/ \
+	.long 0x14004a39; /* addi r10,r10,20			*/ \
+	.long 0xa64b5a7d; /* mthsrr0 r10			*/ \
+	.long 0xa64b7b7d; /* mthsrr1 r11			*/ \
+	.long 0x2402004c; /* hrfid				*/ \
+191:
 
 #endif /* __ASM_UTILS_H */
-- 
2.18.0



More information about the Skiboot mailing list