OP-TEE / optee_os

Trusted side of the TEE
Other
1.51k stars 1.03k forks source link

QEMU: syscall ftrace does not work - RCU #6870

Open jforissier opened 4 weeks ago

jforissier commented 4 weeks ago

Platform: QEMUv7

$ make -j$(nproc) CFG_FTRACE_SUPPORT=y CFG_SYSCALL_FTRACE=y CFG_FTRACE_BUF_SIZE=1000000 CFLAGS_ta_arm32=-pg QEMU_VIRTFS_AUTOMOUNT=y run

NW console:

optee: probing for conduit method.
optee: revision 4.2 (af3fb624)
optee: Asynchronous notifications enabled
optee: dynamic shared memory is enabled
optee: initialized driver
NET: Registered PF_PACKET protocol family
9pnet: Installing 9P2000 support
Registering SWP/SWPB emulation handler
rcu: INFO: rcu_sched detected stalls on CPUs/tasks:
rcu:    0-...0: (6 ticks this GP) idle=0174/1/0x40000000 softirq=97/101 fqs=995
rcu:    (detected by 1, t=2103 jiffies, g=-1107, q=13 ncpus=2)

SW console:

D/LD:  ldelf:176 ELF (f04a0fe7-1f5d-4b9b-abf7-619b85b4ce8c) at 0x123000

So it looks like it hangs as soon as it enters the trusted keys TA.

Commenting out cflags$(sm) += -pg in core/core.mk solves the problem. Adding a few -pg here and there works (for example in Mbed TLS). So I guess we need to find out which core function should not be instrumented.