Debugging with OP-TEE
summary
Overview of concrete debugging work for OP-TEE: describes existing techniques (secure UART abort dumps, symbolize.py to turn TA addresses into symbols, GProf for TA hotspots) and a new function‑tracing proof‑of‑concept that compiles TAs with -pg, stores a Ftrace buffer in TA BSS, records entry/exit (frame‑pointer stack trick), and on abort RPCs the buffer back to Linux T‑supplicant. GDB debugging works on QEMU (load TA symbols only with ASLR disabled). A pull request exists for review.
AI-written summary · about
chapters (16)
- 0:00Intro
- 1:13Agenda
- 2:02Brief OP-TEE background Normal World
- 2:50Basics: GlobalPlatform return code origins Name OxODD00001 The return code is an error that
- 4:32Abort dumps / call stack
- 5:42Symbolize call stack addresses
- 6:11GDB using QEMU GDB con use the debug stubs built into QEMU to perform full symbolic debug of OP-TEE. Steps to debug OP-TEE on QEMU using GDB
- 7:48Profiling: Benchmark framework OP-TEE provides a framework to measure latency values for various architectural layers involved during runtime operation as below. • Round-trip time from a Client Application to a Trusted Application. • Latency to go through each layer
- 8:40Profiling: Benchmark framework design
- 10:02Profiling using gprof OP-TEE supports profiling of user Trusted Applications with prof. Details of profiling data collected are as follows: • Coll graph information Records a pair of program counters caller and calce . Also, records count for particular • PC distribution over time TEE core samples TA program counter (PC) during interruption of TA execution like
- 11:30ftrace - Function tracing GCC compilation with .pg option inserts a special function.mcount for every function entry.
- 12:31ftrace for Linux TEE driver Linux provides ability for dynamic function tracing CONFIG_DYNAMIC_FTRACE-YI
- 13:13ftrace for Linux TEE driver: usage Example usage of function graph for TEE driver opis
- 13:47Function tracing in OP-TEE?
- 14:50OP-TEE: ftrace mechanism
- 16:17OP-TEE: ftrace implementation
related talks
34mA Journey To the Secure World of OPTEE From the Non-secure World of Linux
39mKernel TEE subsystem evolution
48mDPTrace: Dual Purpose Trace for Exploitability Analysis of Program Crashes
50mUsing OP-TEE as a Cryptography Engine
39mHands-on OP-TEE with Andes RISC-V
42mPower Debugging with JTAG
17mDebuggers from scratch
36mDebugging with eBPF on Arm Platforms
