Skip to content

Commit

Permalink
arm64: Initialize sctrl_el1 when running fork
Browse files Browse the repository at this point in the history
Signed-off-by: wangmingrong1 <[email protected]>
  • Loading branch information
W-M-R committed Feb 18, 2025
1 parent 0ae633c commit 3742be9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/arm64/src/common/arm64_fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ pid_t arm64_fork(const struct fork_s *context)

child->cmn.xcp.regs[REG_ELR] = (uint64_t)context->lr;

child->cmn.xcp.regs[REG_SCTLR_EL1] = read_sysreg(sctlr_el1);
#ifdef CONFIG_ARM64_MTE
child->cmn.xcp.regs[REG_SCTLR_EL1] |= SCTLR_TCF1_BIT;
#endif

child->cmn.xcp.regs[REG_EXE_DEPTH] = 0;
child->cmn.xcp.regs[REG_SP_ELX] = newsp - XCPTCONTEXT_SIZE;
#ifdef CONFIG_ARCH_KERNEL_STACK
Expand Down

0 comments on commit 3742be9

Please sign in to comment.