arch/arm64_schedulesigaction.c: Fix signal delivery in EL1 when MMU is enabled

When delivering a signal to a kernel task, or in CONFIG_BUILD_FLAT with MMU
enabled, the REG_SCTLR_EL1 needs to be stored for exception return.

Otherwise 0 is restored to the register at exception return, MMU is switched off
and the  system crashes.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
This commit is contained in:
Jukka Laitinen 2025-08-13 14:26:17 +03:00 committed by Xiang Xiao
parent 83dd57a488
commit 8a157d7514

View file

@ -72,7 +72,8 @@ static void arm64_init_signal_process(struct tcb_s *tcb, uint64_t *regs)
tcb->xcp.regs[REG_SP_EL0] = regs[REG_SP_ELX] - XCPTCONTEXT_SIZE * 2;
#endif
tcb->xcp.regs[REG_SP_ELX] = regs[REG_SP_ELX] - XCPTCONTEXT_SIZE;
tcb->xcp.regs[REG_EXE_DEPTH] = 1;
tcb->xcp.regs[REG_EXE_DEPTH] = 1;
tcb->xcp.regs[REG_SCTLR_EL1] = regs[REG_SCTLR_EL1];
}
/****************************************************************************