OP-TEE/optee_test

tee_ta_open_session:768 Failed. Return error 0xffff3024

jiang-12345678 opened this issue · 6 comments

user@localhost:~$ xtest -t regression 1004
D/TC:? 0 tee_ta_init_pseudo_ta_session:299 Lookup pseudo TA cb3e5ba0-adf1-11e0-998b-0002a5d5c51b
D/TC:? 0 ldelf_load_ldelf:91 ldelf load address 0x40006000
D/LD: ldelf:134 Loading TS cb3e5ba0-adf1-11e0-998b-0002a5d5c51b
D/TC:? 0 ldelf_syscall_open_bin:142 Lookup user TA ELF cb3e5ba0-adf1-11e0-998b-0002a5d5c51b (Secure Storage TA)
D/TC:? 0 ldelf_syscall_open_bin:146 res=0xffff0008
D/TC:? 0 ldelf_syscall_open_bin:142 Lookup user TA ELF cb3e5ba0-adf1-11e0-998b-0002a5d5c51b (REE)
D/TC:? 0 ldelf_syscall_open_bin:146 res=0
D/LD: ldelf:168 ELF (cb3e5ba0-adf1-11e0-998b-0002a5d5c51b) at 0x4007a000
D/TC:1 0 abort_handler:531 [abort] abort in User mode (TA will panic)
E/TC:? 0
E/TC:? 0 User mode undef-abort at address 0x40085f1c
E/TC:? 0 esr 0x6232f801 ttbr0 0x20000fc120020 ttbr1 0x00000000 cidr 0x0
E/TC:? 0 cpu #1 cpsr 0x80000100
E/TC:? 0 x0 0000000040103320 x1 0000000040082dac
E/TC:? 0 x2 0000000040103320 x3 0000000000000000
E/TC:? 0 x4 0000000040082dac x5 0000000000000000
E/TC:? 0 x6 0000000000000000 x7 0000000000000000
E/TC:? 0 x8 0000000000000000 x9 0000000000000000
E/TC:? 0 x10 0000000000000000 x11 0000000000000000
E/TC:? 0 x12 0000000000000000 x13 0000000040025780
E/TC:? 0 x14 0000000000000000 x15 0000000000000000
E/TC:? 0 x16 0000000000000000 x17 0000000000000000
E/TC:? 0 x18 0000000000000000 x19 0000000000000000
E/TC:? 0 x20 0000000000000000 x21 0000000000000000
E/TC:? 0 x22 0000000000000000 x23 0000000000000000
E/TC:? 0 x24 0000000000000000 x25 0000000000000000
E/TC:? 0 x26 0000000000000000 x27 0000000000000000
E/TC:? 0 x28 0000000000000000 x29 0000000040025690
E/TC:? 0 x30 0000000040085f4c elr 0000000040085f1c
E/TC:? 0 sp_el0 0000000040025680
E/LD: Status of TA cb3e5ba0-adf1-11e0-998b-0002a5d5c51b
E/LD: arch: aarch64
E/LD: region 0: va 0x40004000 pa 0xfc200000 size 0x002000 flags rw-s (ldelf)
E/LD: region 1: va 0x40006000 pa 0xfc202000 size 0x011000 flags r-xs (ldelf)
E/LD: region 2: va 0x40017000 pa 0xfc213000 size 0x001000 flags rw-s (ldelf)
E/LD: region 3: va 0x40018000 pa 0xfc214000 size 0x004000 flags rw-s (ldelf)
E/LD: region 4: va 0x4001c000 pa 0xfc218000 size 0x001000 flags r--s
E/LD: region 5: va 0x4001d000 pa 0xfc2a3000 size 0x009000 flags rw-s (stack)
E/LD: region 6: va 0x4007a000 pa 0x00001000 size 0x07a000 flags r-xs [0]
E/LD: region 7: va 0x400f4000 pa 0x0007b000 size 0x010000 flags rw-s [0]
E/LD: [0] cb3e5ba0-adf1-11e0-998b-0002a5d5c51b @ 0x4007a000
E/LD: Call stack:
E/LD: 0x0000000040085f1c
E/LD: 0x0000000040086320
E/LD: 0x0000000040085eb8
E/LD: 0x0000000040094b08
E/LD: 0x0000000040082da8
D/TC:? 0 user_ta_enter:176 tee_user_ta_enter: TA panicked with code 0xdeadbeef
D/TC:? 0 tee_ta_close_session:512 csess 0xfc108d70 id 1
D/TC:? 0 tee_ta_close_session:531 Destroy session
D/TC:? 0 destroy_context:308 Destroy TA ctx (0xfc108d10)
E/TC:? 0 tee_ta_open_session:768 Failed. Return error 0xffff3024

So,what is the reason?

TA is trying to read CNTPCT but platform is configured to prevent it.

Why/where the TA is trying to read CNTPCT? You can find by using scripts/symbolize.py to decode the call stack.
re:./scripts/symbolize.py -d out/arm-plat-ls/core -d ../optee_test/out/ta/crypt/*
nothing print
but cb3e5ba0-adf1-11e0-998b-0002a5d5c51b.dmp can find
ftrace_enter
|
barrier_read_cntpct
|
read_cntpct

Why is CNTPCT read disabled? Probably because EL0PCTEN is 0.
re: #define CNTKCTL_PL0PCTEN BIT(0)
only to set CNTFRQ_EL0 =1 ?

Hi Jforlssler,
why the TA is trying to read CNTPCT?
re: I set CFG_FTRACE_SUPPORT=y.
so run ftrace.

regards,
jiang

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.