-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Fix misc issues and enable v8r64 FPU #58056
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
Fix misc issues and enable v8r64 FPU #58056
Conversation
include/zephyr/spinlock.h
Outdated
#if defined(CONFIG_ARM64) && defined(CONFIG_FPU_SHARING) | ||
extern void z_arm64_flush_local_fpu_proactive(void); | ||
z_arm64_flush_local_fpu_proactive(); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uhm, this could raise some eyebrows. Can you detach this from this PR and make a standalone PR only for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I will, and I also expect there is a better way to fix the issue
This PR depends on #58058. I will rebase this when we get a solution |
@povergoing: The deadlock is a very interesting one. |
… size The test case will show an unexpected exception in the idle thread after all test cases pass. The issue is caused by the main thread stackoverflow. Increase the main stack configured in this test case to fix the issue. Signed-off-by: Jaxson Han <[email protected]>
LOG system has unalignment access instruction which will cause an alignment exception before MPU is enabled. Remove the LOG print before MPU is enabled to avoid this issue. Signed-off-by: Jaxson Han <[email protected]>
Each core should init their own stack during the reset when SMP enabled, but do not touch others. The current init results in each core starting init the stack from the same address which will break others. Fix the issue by setting a correct start address. Signed-off-by: Jaxson Han <[email protected]>
cpu_node_list does not hold the corrent mapping of cpu id and mpid when core booting sequence does not follow the DTS cpu node sequence. This will cause an issue that sgi cannot deliver to the right target. Add the cpu_map array to hold the corrent mapping between cpu id and mpid. Signed-off-by: Jaxson Han <[email protected]>
This commit is to enable FPU and FPU_SHARING for v8r aarch64. Signed-off-by: Jaxson Han <[email protected]>
7ad8e46
to
dbace5c
Compare
I think this is ready for review :) |
This PR fixes some issues and enables the FPU for v8R AArch64
Fix text exception by increasing the stack size
Remove LOG print before MPU is enabled to avoid the potential un-alignment instruction called before MPU is enabled.
Fix the STACK_INIT during the reset
Add cpu_map to have a correct mapping of CPU id and MPID
Fix a deadlock case when using FPU in the spin-locked section (this workaround fixes modified the spinlock, RFC)fix possible deadlock with FPU sharing on ARM64 and RISC-V #58086 fixed the deadlock issueUsing FPU with FPU sharing in a spin-locked critical section might cause a 'deadlock'. When core 0 got a spinlock that other cores are waiting for, it will 'deadlock' if the core 0 current threads' FPU context is living in another one that is waiting for the spinlock but never receives the FPU IPI. CC @npitre
Enable FPU and FPU_SHARING for v8r aarch64
Tested on all runnable Arm64 platforms including
fvp_baser_aemv8r
andfvp_baser_aemv8r_smp