Currently, the trap code switches to the the temporary stack in the dbtrap
section. It works in most cases, but in the beginning of the execution, the
temp stack is being used, as starting in the powerpc_init() code.
In this current scenario, the stack is being overwritten, which causes the
return of breakpoint() to take abnormal execution, as showed in the following
fatal kernel trap:
exception = 0x400 (instruction storage interrupt) virtual address = 0x426f6f7420666c60 srr0 = 0x426f6f7420666c60 (0x426f6f7420666c60) srr1 = 0x8000000040001032 lr = 0x426f6f7420666c61 (0x426f6f7420666c61) curthread = 0x1441460 pid = 0, comm =
In this case, it loads a string ('boot fla') in the corrupted stack and tried
to jump to this place as it is a valid text address.
This current patchset create a small stack to use by the dbtrap: codepath
avoiding the corruption of the temporary stack.