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

TA unwinding on abort (print call stack) #1552

Merged
merged 5 commits into from
May 24, 2017

Commits on May 24, 2017

  1. core: elf_load.c: do not require first segment to be PT_LOAD

    There is no obvious reason for requiring the first program header in a
    user TA to be of type PT_LOAD. It is usually the case, due to the way
    our linker script is written (ta/arch/arm/ta.ld.S). Still, it may occur
    that other segments are inserted first by the linker. For example, when
    linking a 32-bit binary built with unwind tables (-funwind-tables), the
    first PHDR is PT_ARM_EXIDX. Such a TA won't load unless this patch is
    applied.
    
    Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
    jforissier committed May 24, 2017
    Configuration menu
    Copy the full SHA
    1191e65 View commit details
    Browse the repository at this point in the history
  2. core: dump call stack of user TAs on abort

    Update the abort handling code in the TEE core to support unwinding
    the user mode stack in addition to the kernel stack. unwind_arm32.c is
    modified slightly so that it can be built for AArch64. This allows a
    64-bit TEE core to dump both 32- and 64-bit TAs.
    
    Paged TAs (CFG_PAGED_USER_TA=y) cannot currently be unwound, because
    the code is not ready to handle the page faults that might occur as
    the unwinding tables are accessed.
    
    CFG_CORE_UNWIND is renamed to CFG_UNWIND since it enables both the
    kernel and user TA stack dumps. It is still set automatically when
    CFG_TEE_CORE_DEBUG=y.
    
    32-bit user TAs have to be compiled with `-funwind-tables`, otherwise
    the call stack can't be unwound and the abort reports will not show a
    call stack .The TA dev kit takes care of adding this flag automatically
    when CFG_UNWIND=y.
    
    Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
    Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey)
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
    jforissier committed May 24, 2017
    Configuration menu
    Copy the full SHA
    31a2964 View commit details
    Browse the repository at this point in the history
  3. core: cosmetic updates to the abort dumps for better consistency

    Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
    jforissier committed May 24, 2017
    Configuration menu
    Copy the full SHA
    1bc08be View commit details
    Browse the repository at this point in the history
  4. core: show user TA architecture on abort

    In the TA abort message that is sent to the console when a user-mode
    TA crashes, there is currently no clear indication of whether the TA
    was running in 32-bit or 64-bit mode. Add it since it will be useful to
    develop parsing tools.
    
    Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
    Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
    jforissier committed May 24, 2017
    Configuration menu
    Copy the full SHA
    7bbee6e View commit details
    Browse the repository at this point in the history
  5. scripts: add symbolize.py

    Add a helper script to decode call stacks shown in abort messages. The
    script relies on addr2line to convert virtual addresses to debug
    information: 'function at file:line'.
    
    Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
    Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
    Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
    jforissier committed May 24, 2017
    Configuration menu
    Copy the full SHA
    733a15f View commit details
    Browse the repository at this point in the history