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

arm/cxd56: use chip specific vectors to allow smpcall update regs #14363

Merged
merged 5 commits into from
Oct 17, 2024

Conversation

jasonbu
Copy link
Contributor

@jasonbu jasonbu commented Oct 16, 2024

Summary

When sig dispatch do up_schedule_sigaction, need to make a new frame to run arm_sigdeliver. But the exception_direct cannot handle xcp.regs as we are using c-function exception handler.
Need to use exception_common to handle SMP call.

issue from #13606 (comment)
@masayuki2009 please review the update, and see it at your environments also work as expected.

use chip specific vector cxd56_vectors to make CXD56_IRQ_SMP_CALL not use c-call version exception handler.

Impact

can pass the self-test in Spresense CPU=3 case.
for self-test, the _vector still in .map, maybe we should add option to make unique between cxd56_vectors and _vectors.

Testing

CI-test.

./tools/configure.sh -l spresense/smp 
kconfig-tweak --set-val CONFIG_SMP_NCPUS 3
make -j
./tools/flash_writer.py -s -c /dev/ttyUSB0 -d -b 115200 -n nuttx.spk
minicom -D /dev/ttyUSB0 -b 115200 -C log/ttysprense-$(date +"%Y-%m-%d-%H-%M-%S").log
ostest

@github-actions github-actions bot added Arch: arm Issues related to ARM (32-bit) architecture Size: M The size of the change in this PR is medium labels Oct 16, 2024
@jasonbu
Copy link
Contributor Author

jasonbu commented Oct 16, 2024

ramvectors should allso can solve the problem, but not work in my board.

@jasonbu jasonbu changed the title arm/cxd56: use chip specific ramvectors to allow smpcall update regs arm/cxd56: use chip specific vectors to allow smpcall update regs Oct 16, 2024
@masayuki2009
Copy link
Contributor

@jasonbu

When sig dispatch do up_schedule_sigaction, need to make a new frame to run arm_sigdeliver. But the exception_direct cannot handle xcp.regs as we are using c-function exception handler.
Need to use exception_common to handle SMP call.

I think a similar issue would happen with rp2040 (dual Cortex-M0+), lc823450 (dual Cortex-M3) that use exception_direct.
So they should be fixed as well.

@jasonbu
Copy link
Contributor Author

jasonbu commented Oct 16, 2024

@jasonbu

When sig dispatch do up_schedule_sigaction, need to make a new frame to run arm_sigdeliver. But the exception_direct cannot handle xcp.regs as we are using c-function exception handler.
Need to use exception_common to handle SMP call.

I think a similar issue would happen with rp2040 (dual Cortex-M0+), lc823450 (dual Cortex-M3) that use exception_direct. So they should be fixed as well.

let's make sure problem already converged, then talk about how to update correctly. for example if always one smp call have to use exception_common, we should make it a optional as a support in arm_vectors.c.
please give me a feedback if this patch can solve your problem.

@GUIDINGLI
Copy link
Contributor

@masayuki2009

Cause we don't have enough environment to test the code, it leads to regression issues.
Can you provide us with a copy of your testing script so that we can prevent such problems from happening?

As this PR said:
#14007

@masayuki2009
Copy link
Contributor

let's make sure problem already converged, then talk about how to update correctly. for example if always one smp call have to use exception_common, we should make it a optional as a support in arm_vectors.c.
please give me a feedback if this patch can solve your problem.

@jasonbu
I confirmed that this PR fixes #13606 (comment)

@xiaoxiang781216
Copy link
Contributor

let's fix other arm-m SMP chip.

When sig dispatch do up_schedule_sigaction, need to make a new frame to
run arm_sigdeliver. But the exception_direct cannot handle xcp.regs as
we are using c-function exception handler.
Need to use exception_common to handle SMP call.

Signed-off-by: buxiasen <[email protected]>
@xiaoxiang781216 xiaoxiang781216 merged commit bc019cb into apache:master Oct 17, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch: arm Issues related to ARM (32-bit) architecture Size: M The size of the change in this PR is medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants