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

how to debug PTA code? #5438

Closed
huangcm0101 opened this issue Jul 13, 2022 · 5 comments
Closed

how to debug PTA code? #5438

huangcm0101 opened this issue Jul 13, 2022 · 5 comments
Labels

Comments

@huangcm0101
Copy link

hi, guys
I need to run some core tests in optee with EL1, so I create the PTA code in optee-os/core/pta to do it, and I created the optee-example to invoke it.
once the PTA code run core test, panic is observed:

########E/TC:3 0
E/TC:3 0 Core undef-abort at address 0xfe268020
E/TC:3 0 esr 0x02000000 ttbr0 0xfe2b2060 ttbr1 0x00000000 cidr 0x0
E/TC:3 0 cpu #3 cpsr 0x80000104
E/TC:3 0 x0 0000000000000000 x1 0000000000000000
E/TC:3 0 x2 00000000000000ec x3 00000000000000ec
E/TC:3 0 x4 00000000fe21b6f0 x5 0000000000000000
E/TC:3 0 x6 00000000ff701038 x7 0000000000000000
E/TC:3 0 x8 00000000ff701000 x9 0000000000000000
E/TC:3 0 x10 0000000000000000 x11 0000000000000000
E/TC:3 0 x12 0000000000000000 x13 0000000040014fb0
E/TC:3 0 x14 0000000000000000 x15 0000000000000000
E/TC:3 0 x16 00000000fe20f934 x17 0000000000000000
E/TC:3 0 x18 0000000000000000 x19 0000000000000000
E/TC:3 0 x20 00000000fe2b6fd0 x21 00000000fe2b6e80
E/TC:3 0 x22 00000000fe2b70c0 x23 00000000fe2b6fc8
E/TC:3 0 x24 00000000fe2b6fd0 x25 0000000000000001
E/TC:3 0 x26 00000000fe299d30 x27 0000000000000000
E/TC:3 0 x28 0000000000000000 x29 00000000fe2b6e50
E/TC:3 0 x30 00000000fe21b76c elr 00000000fe268020
E/TC:3 0 sp_el0 00000000fe2b6e50
E/TC:3 0 Call stack:
E/TC:3 0 0x00000000fe268020
E/TC:3 0 0x00000000fe205b24
E/TC:3 0 0x00000000fe2175d8
E/TC:3 0 0x00000000fe210cd0
E/TC:3 0 0x00000000fe20864c
E/TC:3 0 Panic '[abort] undefined abort (trap CPU)' at core/arch/arm/kernel/abort.c:464 <get_fault_t>
E/TC:3 0 TEE load address @ 0xfe200000
E/TC:3 0 Call stack:
E/TC:3 0 0x00000000fe20abd8
E/TC:3 0 0x00000000fe216560
E/TC:3 0 0x00000000fe209164
E/TC:3 0 0x00000000fe206318

I searched the document, it seems the tool scripts/symbolize.py is for TA in user space.
could you please guide me how to debug PTA?

@jenswi-linaro
Copy link
Contributor

Symbolize works here too.

@huangcm0101
Copy link
Author

thanks a lot,
I can get some debug message, but it is not enough. I need to investigate which line in my code cause the abort.

3.11.0-r0/git/core/arch/arm/kernel/unwind_arm64.c:79
E/TC:2 0 0x00000000fe216560 __do_panic at /usr/src/debug/optee-os/3.11.0-r0/git/core/kernel/panic.c:24
E/TC:2 0 0x00000000fe209164 get_fault_type at /usr/src/debug/optee-os/3.11.0-r0/git/core/arch/arm/kernel/abort.c:464
E/TC:2 0 0x00000000fe206318 el1_sync_abort at .../optee-os/3.11.0-r0/git/core/arch/arm/kernel/thread_a64.S:733

@etienne-lms
Copy link
Contributor

Try to pass only the 1st part of the log to symbolize, the one that cause the panic.
(+ the 2 header lines 'load address' and 'Call stack' : strange you don't get them in the 1st trace):

E/TC:3 0 TEE load address @ 0xfe200000
E/TC:3 0 Call stack:
E/TC:3 0 0x00000000fe268020
E/TC:3 0 0x00000000fe205b24
E/TC:3 0 0x00000000fe2175d8
E/TC:3 0 0x00000000fe210cd0
E/TC:3 0 0x00000000fe20864c

@jforissier
Copy link
Contributor

jforissier commented Jul 13, 2022

@etienne-lms 3.11.0 lacks the "TEE load address" line, restored in 3.11.0-68-g24d52e47.

@github-actions
Copy link

This issue has been marked as a stale issue because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this issue will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants