summaryrefslogtreecommitdiff
path: root/purgatory
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2015-10-06 17:55:49 -0500
committerSimon Horman <horms@verge.net.au>2015-11-02 11:04:13 +0900
commit3c21acd0fbddedf7b31c5cfddee690b23ee5a83f (patch)
tree204a44e0abfd79e48829036e7944275b6d9d03c4 /purgatory
parent3e123f9419a515856e6870c1ff8dba286b0c47e0 (diff)
downloadkexec-tools-3c21acd0fbddedf7b31c5cfddee690b23ee5a83f.tar.gz
ppc64: Avoid rfid if no need to clear MSR_LE
Commit a304e2d82a8c3 ("ppc64: purgatory: Reset primary cpu endian to big-endian) changed bctr to rfid. rfid is book3s-only and will cause a fatal exception on book3e. Purgatory is an isolated environment which makes importing information about the subarch awkward, so instead rely on the fact that MSR_LE should never be set on book3e, and the rfid is only needed if MSR_LE is set (and thus needs to be cleared). In theory that MSR bit is reserved on book3e, rather than zero, but in practice I have not seen it set. Signed-off-by: Scott Wood <scottwood@freescale.com> Reviewed-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Tested-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'purgatory')
-rw-r--r--purgatory/arch/ppc64/v2wrap.S10
1 files changed, 9 insertions, 1 deletions
diff --git a/purgatory/arch/ppc64/v2wrap.S b/purgatory/arch/ppc64/v2wrap.S
index 179ade9..3534080 100644
--- a/purgatory/arch/ppc64/v2wrap.S
+++ b/purgatory/arch/ppc64/v2wrap.S
@@ -116,9 +116,17 @@ master:
stw 7,0x5c(4) # and patch it into the kernel
mr 3,16 # restore dt address
+ mfmsr 5
+ andi. 10,5,1 # test MSR_LE
+ bne little_endian
+
+ li 5,0 # r5 will be 0 for kernel
+ mtctr 4 # prepare branch to
+ bctr # start kernel
+
+little_endian: # book3s-only
mtsrr0 4 # prepare branch to
- mfmsr 5
clrrdi 5,5,1 # clear MSR_LE
mtsrr1 5