| d720431c | 04-Sep-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
scripts/symbolize.py: get binary architecture from ELF file
Instead of making a fragile assumption, that we have a 64-bit TEE core if we encounter 64-bit registers in the dump, read the architecture
scripts/symbolize.py: get binary architecture from ELF file
Instead of making a fragile assumption, that we have a 64-bit TEE core if we encounter 64-bit registers in the dump, read the architecture from the ELF file itself. This allows to correctly parse 32- and 64-bit TEE core call stacks without any context but the string "Call stack:" at the beginning. Therefore, the helper script can now be used on core panics.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 157e6213 | 24-Aug-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
scripts/symbolize.py: accept -d <ELF_file> in addition to -d <dir>
The -d option of symbolize.py normally expects one or more directories, where the script will look for ELF files (TEE or TA, depend
scripts/symbolize.py: accept -d <ELF_file> in addition to -d <dir>
The -d option of symbolize.py normally expects one or more directories, where the script will look for ELF files (TEE or TA, depending on the input dump). For convenience, let's also accept paths to the actual ELF files. Previously, the script would just ignore file arguments and silently fail to resolve stack traces.
Reported-by: Lijianhui <airbak.li@hisilicon.com> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org>
show more ...
|
| 142c5ccc | 24-Aug-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
scripts/symbolize.py: try to resolve abort address to symbol/section[+offset]
Use nm and objdump to find the symbol and ELF section that match the address reported in the the abort line. This can he
scripts/symbolize.py: try to resolve abort address to symbol/section[+offset]
Use nm and objdump to find the symbol and ELF section that match the address reported in the the abort line. This can help debug writes to read-only data or unaligned accesses to global data, for example.
If the address can be resolved to a symbol plus some offset and/or a section plus some offset, the abort line is printed again just before the call stack with the symbolic information added. Not that the translation cannot be done immediately when the abort line is seen because at this point we don't know the architecture, and we don't have the load address of the TA.
Here is an example (the line added by this patch is marked with >>):
User TA data-abort at address 0x1314d0 (write permission fault) fsr 0x0000080f ttbr0 0x0e07a06a ttbr1 0x0e07406a cidr 0x1 cpu #0 cpsr 0x60000030 r0 0x00000001 r4 0x00102780 r8 0x00000000 r12 0xb736e358 r1 0x00102724 r5 0x00121e4f r9 0x00000000 sp 0x001026e0 r2 0x00000001 r6 0x001026dc r10 0x00000000 lr 0x00105cf1 r3 0x001314d0 r7 0x001026e0 r11 0x00000000 pc 0x00105790 Status of TA 5b9e0e40-2636-11e1-ad9e-0002a5d5c51b (0xe073b70) (active) arch: arm load address: 0x103000 ctx-idr: 1 stack: 0x100000 10240 region 0: va 0x100000 pa 0xe21e000 size 0x3000 region 1: va 0x103000 pa 0xe100000 size 0x2e000 region 2: va 0x131000 pa 0xe12e000 size 0xa000 region 3: va 0x13b000 pa 0xe138000 size 0xe6000 region 4: va 0 pa 0 size 0 region 5: va 0 pa 0 size 0 region 6: va 0 pa 0 size 0 region 7: va 0 pa 0 size 0 >> User TA data-abort at address 0x1314d0 const_val+4 .rodata+4452 (write permission fault) Call stack: 0x00105790 ta_entry_bad_mem_access at optee_test/ta/os_test/os_test.c:917 0x00105cf1 TA_InvokeCommandEntryPoint at optee_test/ta/os_test/ta_entry.c:101 0x00121e33 entry_invoke_command at optee_os/lib/libutee/arch/arm/user_ta_entry.c:207 0x00121e8f __utee_entry at optee_os/lib/libutee/arch/arm/user_ta_entry.c:235
The test TA does the following:
const int const_val[3] = { 1, }; /* ... */ ((int *)const_val)[1] = 2;
Suggested-by: Zeng Tao <prime.zeng@hisilicon.com> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org>
show more ...
|
| 509a9802 | 01-Aug-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
Add support for compressed early TAs
Add decompression code to the early TA loader and update the Python script accordingly. The compression algorithm is "deflate", which is used by zlib and gzip in
Add support for compressed early TAs
Add decompression code to the early TA loader and update the Python script accordingly. The compression algorithm is "deflate", which is used by zlib and gzip in particular. It allows for compression ratios comprised between 3 (for bigger TAs) and 4.7 (for smaller ones). Those numbers were observed with 32-bit TAs (QEMU).
On QEMU (armv7), the code size overhead when CFG_EARLY_TA=y, including the decompressor, is 12K when DEBUG=0 or 20K when DEBUG=1. The decompressor allocates about 39K of heap.
Another library compatible with zlib was tried for comparison [1]. The code size overhead with miniz was 8K (DEBUG=0) or 16K (DEBUG=1). On the other hand, the dynamic allocation was about 43K, so the total memory required was about same. Speed was not compared. In the end, zlib was preferred for licensing reasons and because it is widely used.
Link: [1] https://github.com/richgel999/miniz Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (QEMU) Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (QEMUv8, pager) Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (D02 32/64 bits) Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (D02 32/64 bits, pager) Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| b3be2f66 | 02-Aug-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
Import zlib v1.2.11
Import the decompression code from zlib v1.2.11. From the project's README:
"zlib 1.2.11 is a general purpose data compression library. [...] The data format used by the zlib li
Import zlib v1.2.11
Import the decompression code from zlib v1.2.11. From the project's README:
"zlib 1.2.11 is a general purpose data compression library. [...] The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files rfc1950 (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format)."
This code will be used in a later commit to decompress early TAs. Only the inflate() function is needed, and the library is configured without gzip support. The source files that are not required for inflate() are left aside.
The library is licensed under a permissive license, see `zlib.h`.
Link: http://tools.ietf.org/html/rfc1950 Link: http://tools.ietf.org/html/rfc1951 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| c1d47bcf | 15-May-2017 |
Etienne Carriere <etienne.carriere@linaro.org> |
checkpatch: support tools not supporting argument --typedefsfile
If one relies on a checkpatch tool that does not support argument --typedefsfile, the script will fail whereas it could simply run wi
checkpatch: support tools not supporting argument --typedefsfile
If one relies on a checkpatch tool that does not support argument --typedefsfile, the script will fail whereas it could simply run without this extra feature.
Fixes: 1472c996cca6 ("Take some GP types into account when running patch check tool") Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 849b17bd | 22-Feb-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
checkpatch: accept several commits
If several commit IDs are passed to the script, process them in order. This helps check several commits in a development branch, for instance: ./scripts/checkpat
checkpatch: accept several commits
If several commit IDs are passed to the script, process them in order. This helps check several commits in a development branch, for instance: ./scripts/checkpatch.sh `git rev-list master..HEAD`
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Igor Opaniuk <igor.opaniuk@linaro.org>
show more ...
|