The exception stack was always set up 64 KiB below the ROM, ignoring hash table alignment. Align the stack pointer based on the PVR value.
Cc: Alexander Graf agraf@suse.de Signed-off-by: Andreas Färber andreas.faerber@web.de --- arch/ppc/qemu/start.S | 20 +++++++++++++++++++- 1 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/arch/ppc/qemu/start.S b/arch/ppc/qemu/start.S index 9417098..ac1c0a3 100644 --- a/arch/ppc/qemu/start.S +++ b/arch/ppc/qemu/start.S @@ -334,9 +334,27 @@ GLOBL(_entry):
addis r1, r3, -16 /* ramsize - 1MB */
- /* setup exception stack */ + /* setup hash table */
addis r1, r1, -1 /* - 64 kB */ + + mfpvr r14 /* check if ppc64 */ + li r15, 4 + srw r14, r14, r15 /* >> 4 */ + cmplwi r14, 0x33 + blt 1f + cmplwi r14, 0x7033 + bge 1f + /* ppc64 */ + clrrdi r1, r1, 5 /* & 0xfffffffffff00000 */ + b 2f +1: + /* ppc */ + clrrwi r1, r1, 4 /* & 0xffff0000 */ +2: + + /* setup exception stack */ + mtsprg0 r1
/* setup stack */