There are two lines of code to assign value of sp for ARM64.
Remove one of them.
- regs->sp = user_sp;
regs->pc = entry_func;
regs->cpsr = spsr;
regs->x[13] = user_sp; /* Used when running TA in Aarch32 */
regs->sp = user_sp; /* Used when running TA in Aarch64 */
There are two lines of code to assign value of sp for ARM64. Remove one of them.