ppc64/purgatory: Device tree values should be read/stored in Big Endian
Subsystems (2)
PATCH 1/1 ppc64/purgatory: Device tree values should be read/stored in Big Endian
The purgatory code reads the device tree's version and stores if needed the currently running CPU number. These 2 values are stored in Big Endian format in the device tree and should be byte swapped when running in Little Endian mode.
Without this fix, when running in SMP environment, kexec or kdump kernel may fail booting with the following message :
Failed to identify boot CPU
--- purgatory/arch/ppc64/v2wrap.S | 10 ++++++++++ 1 file changed, 10 insertions(+)
purgatory/arch/ppc64/v2wrap.S +10 -0
@@ -90,10 +90,20 @@ master: LOADADDR(16, dt_offset) ld 3,0(16) # load device-tree address mr 16,3 # save dt address in reg16 +#ifdef __BIG_ENDIAN__ lwz 6,20(3) # fetch version number +#else + li 4,20 + lwbrx 6,3,4 # fetch BE version number +#endif cmpwi 0,6,2 # v2 ? blt 80f +#ifdef __BIG_ENDIAN__ stw 17,28(3) # save my cpu number as boot_cpu_phys +#else + li 4,28 + stwbrx 17,3,4 # Store my cpu as BE value +#endif 80: LOADADDR(6,opal_base) # For OPAL early debug ld 8,0(6) # load the OPAL base address in r8
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Simon Horman
AppliedQuoted 10 lines · Laurent Dufour
The purgatory code reads the device tree's version and stores if needed the currently running CPU number. These 2 values are stored in Big Endian format in the device tree and should be byte swapped when running in Little Endian mode.
Without this fix, when running in SMP environment, kexec or kdump kernel may fail booting with the following message :
Failed to identify boot CPUSigned-off-by Laurent Dufour <[email protected]>
Thanks, applied.
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec