| a2eb5b55 | 18-Apr-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: add mempool API
Adds mempool.h with an API suitable for allocating short-lived object. Based on the internal counterpart in libmpa. This is needed to integrate other bignum implementations
libutils: add mempool API
Adds mempool.h with an API suitable for allocating short-lived object. Based on the internal counterpart in libmpa. This is needed to integrate other bignum implementations.
Reviewed-by: Volodymyr Babchuk <vlad.babchuk@gmail.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| decd9df7 | 02-Feb-2018 |
Victor Chong <victor.chong@linaro.org> |
compiler.h: Avoid macro redefinition
__packed, __noreturn, __unused and __used are already defined in certain environtments, e.g. bionic, so avoid redefining them here.
Signed-off-by: Victor Chong
compiler.h: Avoid macro redefinition
__packed, __noreturn, __unused and __used are already defined in certain environtments, e.g. bionic, so avoid redefining them here.
Signed-off-by: Victor Chong <victor.chong@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 7c0e4b4c | 18-Jan-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
util.h: add CONCAT() macro
Add a macro that can be used to paste evaluated pre-processor tokens in the code.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carri
util.h: add CONCAT() macro
Add a macro that can be used to paste evaluated pre-processor tokens in the code.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b1d7375c | 15-Dec-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
Remove 'All rights reserved' from Linaro files
The text 'All rights reserved' is useless [1]. The Free Software Foundation's REUSE Initiative best practices document [2] does not contain these words
Remove 'All rights reserved' from Linaro files
The text 'All rights reserved' is useless [1]. The Free Software Foundation's REUSE Initiative best practices document [2] does not contain these words. Therefore, we can safely remove the text from the files that are owned by Linaro.
Generated by: spdxify.py --linaro-only --strip-arr optee_os/
Link: [1] https://en.wikipedia.org/wiki/All_rights_reserved Link: [2] https://reuse.software/practices/ Link: [3] https://github.com/jforissier/misc/blob/f7b56c8/spdxify.py Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| 78b7c7c7 | 15-Dec-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
Remove license notice from Linaro files
Now that we have added SPDX identifiers, we can safely remove the verbose license text from the files that are owned by Linaro.
Generated by [1]: spdxify.p
Remove license notice from Linaro files
Now that we have added SPDX identifiers, we can safely remove the verbose license text from the files that are owned by Linaro.
Generated by [1]: spdxify.py --linaro-only --strip-license-text optee_os/
Link: [1] https://github.com/jforissier/misc/blob/f7b56c8/spdxify.py Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| 1bb92983 | 15-Dec-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
Add SPDX license identifiers
Adds one SPDX-License-Identifier line [1] to each source files that contains license text.
Generated by [2]: spdxify.py --add-spdx optee_os/
The scancode tool [3] wa
Add SPDX license identifiers
Adds one SPDX-License-Identifier line [1] to each source files that contains license text.
Generated by [2]: spdxify.py --add-spdx optee_os/
The scancode tool [3] was used to double check the license matching code in the Python script. All the licenses detected by scancode are either detected by spdxify.py, or have no SPDX identifier, or are false matches.
Link: [1] https://spdx.org/licenses/ Link: [2] https://github.com/jforissier/misc/blob/f7b56c8/spdxify.py Link: [3] https://github.com/nexB/scancode-toolkit Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| fb7ef469 | 15-Dec-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
Reformat copyright/license header in files with an SPDX ID
Some files were committed with an SPDX license identifier before the rules were defined [1]. Reformat them accordingly.
[1] documentation/
Reformat copyright/license header in files with an SPDX ID
Some files were committed with an SPDX license identifier before the rules were defined [1]. Reformat them accordingly.
[1] documentation/copyright_and_license_headers.rst
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| 546291f4 | 15-Dec-2017 |
Joakim Bech <joakim.bech@linaro.org> |
trace: make output more compact
The new format for traces are: <type>/<where>:<thread_id> [<func:line>] <message>
<type>: D = DEBUG E = ERROR I = INFO F = FLOW
<where>: TA = Trusted Ap
trace: make output more compact
The new format for traces are: <type>/<where>:<thread_id> [<func:line>] <message>
<type>: D = DEBUG E = ERROR I = INFO F = FLOW
<where>: TA = Trusted Application TC = TEE Core
I.e, it outputs messages like this: D/TC:00 ta_load:316 ELF load address 0x101000 etc
Thread ID will either take a single or two digits depending on the number of threads in use.
Signed-off-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 4395abf7 | 28-Nov-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: add atomic load, store and cas
* Adds atomic_load_uint() and atomic_load_u32() * Adds atomic_store_uint() and atomic_store_u32() * Adds atomic_cas_uint() and atomic_cas_u32(), compare and
libutils: add atomic load, store and cas
* Adds atomic_load_uint() and atomic_load_u32() * Adds atomic_store_uint() and atomic_store_u32() * Adds atomic_cas_uint() and atomic_cas_u32(), compare and store
Reviewed-by: Volodymyr Babchuk <vlad.babchuk@gmail.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 8473540d | 02-Nov-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
Keep assembly functions in separate sections
To get a more fine grained selection of which area (init, paged, unpaged) an assembly function is assigned do the equivalent of -ffunction-sections but i
Keep assembly functions in separate sections
To get a more fine grained selection of which area (init, paged, unpaged) an assembly function is assigned do the equivalent of -ffunction-sections but in assembly.
Some functions has to be in specific places in the binary for a successful boot, link script is updated accordingly.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| ade14125 | 13-Oct-2017 |
Kevin Peng <kevinp@marvell.com> |
Util: add ASM version ROUNDDOWN and ROUNDUP definitions
Add ROUNDDOWN and ROUNDUP definitions for ASM version which are different from C versions
Signed-off-by: Kevin Peng <kevinp@marvell.com> Revi
Util: add ASM version ROUNDDOWN and ROUNDUP definitions
Add ROUNDDOWN and ROUNDUP definitions for ASM version which are different from C versions
Signed-off-by: Kevin Peng <kevinp@marvell.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| a5ebede8 | 13-Oct-2017 |
Kevin Peng <kevinp@marvell.com> |
Util: add some useful SIZE definitions
Add some useful SIZE_XX definitions like 4k, 1M, etc...
Signed-off-by: Kevin Peng <kevinp@marvell.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.
Util: add some useful SIZE definitions
Add some useful SIZE_XX definitions like 4k, 1M, etc...
Signed-off-by: Kevin Peng <kevinp@marvell.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| dd3afbac | 05-Oct-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
Add CFG_CORE_LARGE_PHYS_ADDR for 64bit paddr_t
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> |
| d0c63614 | 25-Jul-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
Add support for early Trusted Applications
Early TAs are user-mode Trusted Applications that are embedded at link time in the TEE binary. A special read-only data section is used to store them (.rod
Add support for early Trusted Applications
Early TAs are user-mode Trusted Applications that are embedded at link time in the TEE binary. A special read-only data section is used to store them (.rodata.early_ta). A Python script takes care of converting the TAs into a C source file with the proper linker section attribute.
The feature is disabled by default. To enable it, the paths to the TA binaries have to be given in $(EARLY_TA_PATHS). They should be ELF files. Typical build steps: $ make ... CFG_EARLY_TA=y ta_dev_kit # (1) $ # ... build the TAs ... # (2) $ make ... EARLY_TA_PATHS=path/to/<uuid>.stripped.elf # (3) Notes: - Setting CFG_EARLY_TA=y during the first step (1) is not necessary, but it will avoid rebuilding libraries during the third step (3) - CFG_EARLY_TA is automatically enabled when EARLY_TA_PATHS is non-empty in step (3) - Several TAs may be given in $(EARLY_TA_PATHS) (3)
Early TAs are given a higher load priority than REE FS TAs, since they should be available even before tee-supplicant is ready.
Suggested-by: Zeng Tao <prime.zeng@hisilicon.com> 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 ...
|
| 4e07a7b1 | 11-Aug-2017 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: fix memory address comparison
Addresses are unsigned values. Subtracting address values results in an unsigned value. Since qsort comparison function expects a signed integer return value, the
core: fix memory address comparison
Addresses are unsigned values. Subtracting address values results in an unsigned value. Since qsort comparison function expects a signed integer return value, the unsigned address subtraction value gets signed and can produce a wrong result. This change overcomes the issue by producing a +1/0/-1 signed value based on the address unsigned values comparison.
Introduce CMP_TRILEAN() in util.h to implement the operation.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Etienne Carriere <etienne.carriere@linaro.org> (b2260) Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 2bfab756 | 13-Jun-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
trace.c: show file/line info for flow, debug and error messages
Since commit f4aa5b11f9a3 ("Update trace format to be less verbose in INFO and ERROR levels"), INFO and ERROR messages don't show sour
trace.c: show file/line info for flow, debug and error messages
Since commit f4aa5b11f9a3 ("Update trace format to be less verbose in INFO and ERROR levels"), INFO and ERROR messages don't show source file and line information by default, while message with lower severity (DEBUG and FLOW) do contain such information. While it is OK for INFO, it turns out to be inconvenient for ERRORs during development, because one typically wants to be able to quickly locate the source of errors. This patch fixes the problem by introducing a mask rather than a level to control the long output format. This allows individual selection of which level should use a long vs. short format. The compile-time setting CFG_MSG_LONG_PREFIX_THRESHOLD is replaced by CFG_MSG_LONG_PREFIX_MASK with default value 0x1a (= BIT(TRACE_ERROR) | BIT(TRACE_DEBUG) | BIT(TRACE_FLOW)).
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| c2177a2a | 24-May-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
Sparse fix __HAVE_BUILTIN_OVERFLOW
Never define __HAVE_BUILTIN_OVERFLOW if __CHECKER__ is defined.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wi
Sparse fix __HAVE_BUILTIN_OVERFLOW
Never define __HAVE_BUILTIN_OVERFLOW if __CHECKER__ is defined.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 23660121 | 08-Mar-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: remove __early_bss
Initialize the .bss section early from assembler before entering C code. As a result, the __early_bss qualifier is not needed anymore. Remove it, as well as the related symb
core: remove __early_bss
Initialize the .bss section early from assembler before entering C code. As a result, the __early_bss qualifier is not needed anymore. Remove it, as well as the related symbols (__early_bss_start and __early_bss_end).
This makes the code simpler hence easier to maintain, at the expense of initialization time, since .bss is cleared before CPU caches are turned on (and doing it later would mean some C function have been called already). Here are some performance numbers measured on HiKey. The "memset" column measures the time it takes to clear .bss in C, without this patch. The "assembly" column reports the time taken by the clear_bss loop in this patch. Timings were performed using CNTPCT. Worst case is a ~1 ms overhead in boot time.
memset(): | assembly: ms (bytes) | ms (bytes) --------------+-------------- Aarch64 0.30 (72824) | 0.08 (73528) Aarch32 0.27 (65016) | 1.24 (65408) Aarch32/pager 0.03 (11328) | 0.23 (11736)
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> (HiKey 32/64) Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey/pager) Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| ce0d8e2d | 22-May-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
util: add macros for arithmetics with overflow checking
Compiler builtin support for checking overflow of addition, subtraction and multiplication is used if available. If unavailable a fallback imp
util: add macros for arithmetics with overflow checking
Compiler builtin support for checking overflow of addition, subtraction and multiplication is used if available. If unavailable a fallback implementation using macros is used instead.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey 32/64) Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 31a29642 | 11-May-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
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 slightl
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>
show more ...
|
| 63988d7c | 09-May-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
Fix ROUNDUP()/ROUNDDOWN() macros
Fixes the ROUNDUP()/ROUNDDOWN() macros to mask internally with a bitmask that is of the same size as the value that is to be rounded. Without this patch the mask use
Fix ROUNDUP()/ROUNDDOWN() macros
Fixes the ROUNDUP()/ROUNDDOWN() macros to mask internally with a bitmask that is of the same size as the value that is to be rounded. Without this patch the mask uses the size of the type of the @size parameter, which can differ and give wrong result.
Reported-by: Zhizhou Zhang <zhizhouzhang@asrmicro.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 933a11e0 | 19-Dec-2016 |
Andrew F. Davis <afd@ti.com> |
libutils: Add GENMASK_{32,64} helper macros
Allow defining a bitmask using first and last bits.
Signed-off-by: Andrew F. Davis <afd@ti.com> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> |
| 883c4be3 | 13-Oct-2016 |
Jerome Forissier <jerome.forissier@linaro.org> |
Add support for user TA profiling with gprof (-pg)
Adds the infrastructure to collect profiling information from Trusted Applications running in user mode and instrumented with -pg. Enable with: CFG
Add support for user TA profiling with gprof (-pg)
Adds the infrastructure to collect profiling information from Trusted Applications running in user mode and instrumented with -pg. Enable with: CFG_TA_GPROF_SUPPORT=y.
Profiling support in itself adds no significant performance overhead. Instrumented applications however may run 1.3x - 2x slower, and have a larger .bss section (+1.36 times .text size for 32-bit TAs, +1.77 times .text size for 64-bit ones).
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (D02 64-bit) Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (QEMU 32-bit) Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 59c2b6bf | 08-Dec-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
Format UUID strings correctly
Prior to this patch although GlobalPlatform specifies that TAs and such are identified with UUIDs, we don't format them quite right when turning them into strings. Per
Format UUID strings correctly
Prior to this patch although GlobalPlatform specifies that TAs and such are identified with UUIDs, we don't format them quite right when turning them into strings. Per https://www.ietf.org/rfc/rfc4122.txt, there should be another hyphen after the first two bytes of clockSeqAndNode.
Unfortunately, fixing this breaks compatibility between how TAs are built, and when the OS loads them.
With this patch UUID string are formated with the additional hyphen as for instance: f81d4fae-7dec-11d0-a765-00a0c91e6bf6
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Fixes: https://github.com/OP-TEE/optee_os/issues/857 Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 2ffdd194 | 26-Oct-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
Remove legacy tee_common_unpg.h
Removes legacy file core/include/kernel/tee_common_unpg.h and updates with new types etc as needed.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Teste
Remove legacy tee_common_unpg.h
Removes legacy file core/include/kernel/tee_common_unpg.h and updates with new types etc as needed.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Etienne Carriere <etienne.carriere@linaro.org> (b2260) Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|