Core/Plat: Allow platform specific panic sequence - #6423
Conversation
| write_cntv_ctl(read_cntv_ctl() | ARM_CNTXCTL_IMASK); | ||
| } | ||
|
|
||
| /* SGI9 (secure SGI 1) informs targeted CPU it shall reset */ |
etienne-lms
left a comment
There was a problem hiding this comment.
Could you remove the Change-id tag from 1st commit message?
Yes, my bad |
Implement a new function plat_panic() for platform panic sequence. The default weak implementation traps CPU in an endless loop. Platforms can override the weak implementation for a specific panic sequence. Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Implement a platform specific sequence where the non-secure context can be dumped when a panic occurs, should the log level be sufficient. If there are two cores: raise an interrupt so that is can be stopped as well. Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
Add missing error code management Ass missing cpu_spin_unlock() Other minor fixes Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
|
Comments adressed for MP1 implementation and @jforissier 's tag applied |
|
For "core: panic: platform specific panic sequence" please apply: |
|
I'm having second thoughts about this. I'm not so keen on all these weak functions acting like platform hooks, especially a platform hook like this that solves the problem for one platform, but by default leaves all other platforms in the dark. I believe this would make sense as a generic option instead. With something like "core: itr_raise_sgi() updates" from #6394, but with an |
|
Would you prefer platforms to statically or dynamically register (or not) a platform panic handler, instead of a weak function? By statically I meant something like how Or an even more generic solution based on a config switches? Something like a pair of switch like
|
No, that's still a platform solution.
Yes, something like this is what I had in mind.
OK, I have a patch for this, I'll create a PR. |
|
Feel free to cherry-pick https://github.com/jenswi-linaro/optee_os/tree/sgi_update and use that. I'm afraid that I've only been able to test |
Thank you, I'll will try something generic and test it on our platforms. |
|
Follow-up: https://github.com/OP-TEE/optee_os/pull/6440 |
|
Closed, accepted version: #6440 |
When panicking, there may be the need to stop the other core or have a specific sequence.
Define a weak plat_panic() function to do such operations and add an implementation for STM32MP1x platforms.