OP-TEE: ldelf
2024-11-17
| 2025-1-12
本文字數 770閱讀時長 2 分鐘
type
status
date
slug
summary
tags
category
icon
password
⚠️
The code is based on: https://gitlab.com/riseproject/riscv-optee/optee_os/-/tree/dev-optee-mpxy Commit ID: 75df9ba41a404aec897399ead0ff0aebcbff48ca
  • ldelf_hex.c is generated by scripts/gen_ldelf_hex.py from the input file: ldelf.elf and is included by OP-TEE, i.e. ldelf_data[], ldelf_code_size, ldelf_data_size, and ldelf_entry.
    • ldelf sources: <optee-src>/ldelf/
    • ldelf is running in U-mode.

  • scall_handle_ldelf()
    • Handle syscall according to ldelf_syscall_table:

  • _ldelf_start()
    • ldelf()
      • ta_elf_load_main()
        • load_main()
          • init_elf()
    • _ldelf_return()
      • Issue LDELF_RETURN syscall, which will eventually call syscall_sys_return()

  • ldelf_syscall_open_bin()
    • If the session is for user TAs, look up user TA ELF by UUID. Currently, there are three ways (TA storages) to load user TA in OP-TEE:
      • Early TA
      • REE filesystem TA
      • REE-FS TA rollback protection

      • Each TA storage is registered by REGISTER_TA_STORE() and is stored into ta_stores scattered array in the priority order, e.g.
    • Iterates each TA storage, call their op->open() callback, e.g. ree_fs_ta_open() .
      • Each TA storage's op->open() is responsible for comparing UUID (either by itself or through thread RPC) to determine whether user TA for UUID can be found or not.
        • Returns TEE_ERROR_ITEM_NOT_FOUND if user TA for UUID cannot be found.
  • OP-TEE
  • OP-TEE: RPCOP-TEE: REE filesystem TA
    Loading...
    目錄