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
armv8-m: make the securefault handled by non-securefult #5845
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tee is secure cpu and ap is non-secure cpu. The crash PC can get by IP (R12). [ EMERG] [tee] arm_hardfault: Hard Fault escalation: [ EMERG] [tee] arm_securefault: PANIC!!! Secure Fault: [ EMERG] [tee] arm_securefault: IRQ: 3 regs: 0x2400ff00 [ EMERG] [tee] arm_securefault: BASEPRI: 000000e0 PRIMASK: 00000000 IPSR: 00000003 CONTROL: 0000000c [ EMERG] [tee] arm_securefault: CFSR: 00000000 HFSR: 40000000 DFSR: 00000000 [ EMERG] [tee] arm_securefault: BFAR: 08006008 AFSR: 00000000 SFAR: 3c049ea0 [ EMERG] [tee] arm_securefault: Secure Fault Reason: [ EMERG] [tee] arm_securefault: Attribution unit violation [ EMERG] [tee] arm_securefault_handled_by_ns: Non-sec sp 3c475678 [ EMERG] [ap] arm_busfault: PANIC!!! Bus Fault: [ EMERG] [ap] arm_busfault: IRQ: 5 regs: 0x3c475608 [ EMERG] [ap] arm_busfault: BASEPRI: 000000e0 PRIMASK: 00000000 IPSR: 00000005 CONTROL: 00000004 [ EMERG] [ap] arm_busfault: CFSR: 00000100 HFSR: 40000000 DFSR: 00000000 BFAR: 08006008 AFSR: 20000000 [ EMERG] [ap] arm_busfault: Bus Fault Reason: [ EMERG] [ap] arm_busfault: Instruction bus error [ EMERG] [ap] up_assert: Assertion failed at file:armv8-m/arm_busfault.c line: 105 task: nsh_main [ EMERG] [ap] backtrace: [ EMERG] [ap] [ 9] [<0x2c565246>] up_backtrace+0xa/0x168 [ EMERG] [ap] [ 9] [<0x2c550118>] sched_dumpstack+0x1c/0x60 [ EMERG] [ap] [ 9] [<0x2c5645d6>] up_assert+0x4e/0x324 [ EMERG] [ap] [ 9] [<0x2c54a98e>] _assert+0x2/0x10 [ EMERG] [ap] [ 9] [<0x2c5636d4>] arm_busfault+0xc8/0x15c [ EMERG] [ap] [ 9] [<0x2c523070>] irq_dispatch+0x40/0x11c [ EMERG] [ap] [ 9] [<0x2c563424>] arm_doirq+0x28/0x3c [ EMERG] [ap] [ 9] [<0x2c55c892>] exception_common+0x4a/0xac [ EMERG] [ap] [ 9] [<0x2c58668e>] nsh_parse_command+0x976/0x12b4 [ EMERG] [ap] [ 9] [<0x2c849cee>] write+0x52/0x74 [ EMERG] [ap] [ 9] [<0x2c58c0ac>] nsh_session+0x2c/0x1c8 [ EMERG] [ap] [ 9] [<0x2c58d82c>] nsh_consolemain+0x28/0x54 [ EMERG] [ap] [ 9] [<0x2c590352>] nsh_main+0x2a/0x48 [ EMERG] [ap] [ 9] [<0x2c5500da>] cxx_initialize+0x2a/0x4c [ EMERG] [ap] [ 9] [<0x2c550090>] nxtask_startup+0x14/0x34 [ EMERG] [ap] [ 9] [<0x2c52966a>] nxtask_start+0x92/0xb8 [ EMERG] [ap] arm_registerdump: R0: 3c049ea0 R1: 00000004 R2: 3c448f98 R3: 00000000 [ EMERG] [ap] arm_registerdump: R4: 3c476a98 R5: 3c049ea0 R6: 00000000 FP: 3c476aac [ EMERG] [ap] arm_registerdump: R8: 2c5873c9 SB: 3c049ea0 SL: 3c2e98fc R11: 3c284c2c [ EMERG] [ap] arm_registerdump: IP: 2c58ba4a SP: 3c4756e0 LR: 3c049ea4 PC: 00000000 [ EMERG] [ap] arm_registerdump: xPSR: 610f0000 BASEPRI: 000000e0 CONTROL: 00000004 [ EMERG] [ap] arm_registerdump: EXC_RETURN: ffffffa8 [ EMERG] [ap] arm_dump_stack: IRQ Stack: [ EMERG] [ap] arm_dump_stack: sp: 3c41c900 Signed-off-by: ligd <liguiding1@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
pkarashchenko
approved these changes
Mar 28, 2022
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.
LGTM!
xiaoxiang781216
approved these changes
Mar 28, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
armv8-m: make the securefault handled by non-securefult
If non-secure generated securefault, then we can't get non-secure PC and backtrace in secure ENV (TEE).
So, this patch provide a method, return the securefault IRQ, back to non-secure env, and crash.
Then we can get the error PC and backtrace, this is very useful for debugging.
Impact
armv8-m secure
Testing
VELA