arm64_fpu: Remove fpu_regs from the TCB

Since FPU is now always saved into the current process stack location
upon exception entry, there is no need to keep fpu_regs (or saved_fpu_regs)
in the TCB.
This commit is contained in:
Ville Juven 2024-10-02 10:16:47 +03:00 committed by Xiang Xiao
parent b3107a1f1b
commit 30aa947b95
3 changed files with 7 additions and 20 deletions

View File

@ -268,11 +268,6 @@ struct xcptcontext
uint64_t *saved_reg;
#ifdef CONFIG_ARCH_FPU
uint64_t *fpu_regs;
uint64_t *saved_fpu_regs;
#endif
/* Extra fault address register saved for common paging logic. In the
* case of the pre-fetch abort, this value is the same as regs[REG_ELR];
* For the case of the data abort, this value is the value of the fault

View File

@ -102,14 +102,15 @@ int arm64_syscall_save_context(uint64_t * regs)
#ifdef CONFIG_ARCH_FPU
rtcb = (struct tcb_s *)f_regs->regs[REG_X1];
p_save += XCPTCONTEXT_GP_SIZE;
p_save += XCPTCONTEXT_GP_REGS;
if (rtcb_cur == rtcb)
{
arch_save_fpucontext(p_save);
}
else
{
p_fpu = (uint64_t *)rtcb->xcp.fpu_regs;
p_fpu = (uint64_t *)rtcb->xcp.regs;
p_fpu += XCPTCONTEXT_GP_REGS;
for (i = 0; i < XCPTCONTEXT_FPU_REGS; i++)
{
p_save[i] = p_fpu[i];

View File

@ -130,9 +130,6 @@ pid_t arm64_fork(const struct fork_s *context)
uint64_t stackutil;
char *stack_ptr;
struct regs_context *pforkctx;
#ifdef CONFIG_ARCH_FPU
struct fpu_reg *pfpuctx;
#endif
/* Allocate and initialize a TCB for the child task. */
@ -189,16 +186,6 @@ pid_t arm64_fork(const struct fork_s *context)
stack_ptr = (char *)newsp;
#ifdef CONFIG_ARCH_FPU
pfpuctx = STACK_PTR_TO_FRAME(struct fpu_reg, stack_ptr);
child->cmn.xcp.fpu_regs = (uint64_t *)pfpuctx;
memcpy(pfpuctx, &context->fpu, sizeof(struct fpu_reg));
stack_ptr = (char *)pfpuctx;
#endif
pforkctx = STACK_PTR_TO_FRAME(struct regs_context, stack_ptr);
pforkctx->regs[REG_X0] = 0;
@ -247,6 +234,10 @@ pid_t arm64_fork(const struct fork_s *context)
child->cmn.xcp.regs = (uint64_t *)pforkctx;
#ifdef CONFIG_ARCH_FPU
memcpy(&pforkctx->fpu_regs, &context->fpu, sizeof(struct fpu_reg));
#endif
/* And, finally, start the child task. On a failure, nxtask_start_fork()
* will discard the TCB by calling nxtask_abort_fork().
*/