Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arm64 irq1 #13520

Merged
merged 5 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions arch/arm64/src/common/arm64_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,9 @@ struct regs_context
uint64_t spsr;
uint64_t sp_el0;
uint64_t exe_depth;
#ifdef CONFIG_ARCH_FPU
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the content of this patch needed by SMP too ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removable of FPU trap reason:

  1. The FPU trap logic is not stable in some SMP situation (HERE haven't the detail analysis)
  2. Make the logic Complex and different to read.
  3. The most important reason: it has almost no benefit for the performance, because the compiler will optimize the code with float/double instructions when use the option -O3 (always be). Even the printf/syslog will use use the FPU, so the FPU is used too often and almost each context switch.
    Or, you must use -mgeneral-regs-only to limit the FPU registers usage, that will harmful for the speed.
  4. How about use the FPU registers in the IRQ/SVC ISR, maybe there are hidden bugs ?

struct fpu_reg fpu_regs;
#endif
};

/****************************************************************************
Expand Down Expand Up @@ -391,6 +394,26 @@ static inline void arch_nop(void)
__asm__ volatile ("nop");
}

/****************************************************************************
* Name:
* arm64_current_el()
*
* Description:
*
* Get current execution level
*
****************************************************************************/

#define arm64_current_el() \
({ \
uint64_t __el; \
int __ret; \
__asm__ volatile ("mrs %0, CurrentEL" \
: "=r" (__el)); \
__ret = GET_EL(__el); \
__ret; \
})

/****************************************************************************
* Name:
* read_/write_/zero_ sysreg
Expand Down
6 changes: 0 additions & 6 deletions arch/arm64/src/common/arm64_exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@ void up_exit(int status)
*/

enter_critical_section();

/* Destroy the task at the head of the ready to run list. */
#ifdef CONFIG_ARCH_FPU
arm64_destory_fpu(tcb);
#endif

nxtask_exit();

/* Now, perform the context switch to the new ready-to-run task at the
Expand Down
Loading
Loading