arm64: Initialize sctrl_el1 when running fork

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
This commit is contained in:
wangmingrong1 2025-02-18 11:18:43 +08:00 committed by GUIDINGLI
parent e4ca1a2de9
commit e28c0b4ef1

View file

@ -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