summaryrefslogtreecommitdiffstats
path: root/purgatory
diff options
context:
space:
mode:
authorMilton Miller <miltonm@bga.com>2009-01-02 15:04:42 -0600
committerSimon Horman <horms@verge.net.au>2009-01-16 09:41:05 +1100
commit79c650e757561b03163da73dfc367f702248ef98 (patch)
tree0ec07bffcd15fc82242ff9bc553ebcb023999ec2 /purgatory
parente8f2de09b52c3f4e23f907a6f6bf837b1f45af50 (diff)
downloadkexec-tools-79c650e757561b03163da73dfc367f702248ef98.tar.gz
ppc64: update kdump for 2.6.28 relocatable kernel
The kernel updated its ABI to tell the relocatable kernel to run where it was loaded. We now need to set a flag in the kernel image. Since we only have the kernel image avialable as const data to kexec-tools c code, set the flag in the copy we put in purgatory, and have it set the flag in the kernel (after purgatory has run its checksum). To simplfy the purgatory code we can always copy the flag word back to the kernel as the c code made a copy of the original flag value. Signed-off-by: Milton Miller <miltonm@bga.com> Tested-by: M. Mohan Kumar <mohan@in.ibm.com> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'purgatory')
-rw-r--r--purgatory/arch/ppc64/v2wrap.S21
1 files changed, 9 insertions, 12 deletions
diff --git a/purgatory/arch/ppc64/v2wrap.S b/purgatory/arch/ppc64/v2wrap.S
index f69dad2d..3f786202 100644
--- a/purgatory/arch/ppc64/v2wrap.S
+++ b/purgatory/arch/ppc64/v2wrap.S
@@ -45,11 +45,14 @@
oris rn,rn,name##@h; \
ori rn,rn,name##@l
-#define KDUMP_SIGNATURE 0xfeed1234
-
.machine ppc64
.globl purgatory_start
purgatory_start: b master
+ .org purgatory_start + 0x5c # ABI: possible run_at_load flag at 0x5c
+ .globl run_at_load
+run_at_load:
+ .long 0
+ .size run_at_load, . - run_at_load
.org purgatory_start + 0x60 # ABI: slaves start at 60 with r3=phys
slave: b $
.org purgatory_start + 0x100 # ABI: end of copied region
@@ -57,7 +60,7 @@ slave: b $
#
# The above 0x100 bytes at purgatory_start are replaced with the
-# code from the kernel (or next stage) by kexec/arch/ppc64/kexec-ppc64.c
+# code from the kernel (or next stage) by kexec/arch/ppc64/kexec-elf-ppc64.c
#
master:
@@ -65,7 +68,6 @@ master:
isync
mr 17,3 # save cpu id to r17
mr 15,4 # save physical address in reg15
- mr 18,6 # save kdump flag in reg18
LOADADDR(6,my_toc)
ld 2,0(6) #setup toc
@@ -92,18 +94,13 @@ master:
80:
LOADADDR(6,kernel)
ld 4,0(6) # load the kernel address
+ LOADADDR(6,run_at_load) # the load flag
+ lwz 7,0(6) # possibly patched by kexec-elf-ppc64
+ stw 7,0x5c(4) # and patch it into the kernel
li 5,0 # r5 will be 0 for kernel
mtctr 4 # prepare branch too
mr 3,16 # restore dt address
- LOADADDR(6,KDUMP_SIGNATURE)
- cmpd 18,6
- bne regular
- li 7,1
- std 7,24(4) # mark kdump flag at kernel
-regular:
- lwz 7,0(4) # get the first instruction that we stole
- stw 7,0(0) # and put it in the slave loop at 0
# skip cache flush, do we care?
bctr # start kernel