Does kexec support SMP on powerpc? E500 V2

wilbur.chan wilbur512 at gmail.com
Sun Aug 30 01:51:09 EDT 2009


2009/8/28 M. Mohan Kumar <mohan at in.ibm.com>:

>
> Wilbur, I am not sure about ppc32 arch. Check
> kexec/purgatory/arch/ppc64/v2wrap.S which makes all secondary cpus to spin
> in a loop at the physical address 0x60
>
> Regards,
> M. Mohan Kumar
>

 I've read the code of kexec-elf-ppc64.c and v2wrap.S,

but got quit confused .


Hmmm...  as matter of fact, I'm not quit familliar with the principle
of  purgatory , because I

modified the standard kexec-tool that , I only passed in the kernel
segment , without any

ramdisk or other segments.


My questions are as followed:




q1:  const unsigned char purgatory[] =...  (kexec/purgatory.c)


 where are the  elements in Array 'purgatory'  coming from ?

Is it the binary form of  v2wrap.S ?





 (kexec_elf_ppc64.c)

q2:   elf_rel_build_load(info, &info->rhdr, (const char *)purgatory,\
purgatory_size, 0, max_addr, 1, 0);

Does  the 'purgatory' here stand for the array above or v2wrap.S ?  or both?

What is this code used for?

q3:   elf_rel_get_symbol(&info->rhdr, "purgatory_start", slave_code,
			sizeof(slave_code));
   master_entry = slave_code[0];

 Does  master_entry euqal to the address of instruction 'b  master' in
v2wrap.S ?


q4:  memcpy(slave_code, info->segment[0].buf, sizeof(slave_code));

why coying 256 bytes  of kernel data to  slave_code ,  modify first 4 bytes

to  master_entry,then copy back to info->rhdr ?

Why doing this?



I saw comment saying :

'a copy of the first 0x100 bytes of this code(v2wrap.S)   is copied to
0, and , The above 0x100

bytes at purgatory_start are replaced with the  code from the kernel'

After this,  how the slave cpus jumps to 'slave' point in v2wrap.S  ,
while  master cpu jumps to

'purgatory_start' ?


Thank you



regards,

wilbur



More information about the kexec mailing list