| #
ecdedc94 |
| 14-May-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
util: update fallback SUB_OVERFLOW() macro
Updates the fallback SUB_OVERFLOW() macro to better support mixed types in the arguments.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-b
util: update fallback SUB_OVERFLOW() macro
Updates the fallback SUB_OVERFLOW() macro to better support mixed types in the arguments.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
9a8117de |
| 14-May-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
util: update fallback ADD_OVERFLOW() macro
Updates the fallback ADD_OVERFLOW() macro to better support mixed types in the arguments.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-b
util: update fallback ADD_OVERFLOW() macro
Updates the fallback ADD_OVERFLOW() macro to better support mixed types in the arguments.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
86ab9ffe |
| 08-May-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
util: fix fallback SUB_OVERFLOW() macro
This only applies when the compiler doesn't provide the __builtin_sub_overflow() function (before GCC 5.1).
Fixes problem due to integer promotion in overflo
util: fix fallback SUB_OVERFLOW() macro
This only applies when the compiler doesn't provide the __builtin_sub_overflow() function (before GCC 5.1).
Fixes problem due to integer promotion in overflow macros when result is a signed type and the subtrahend is an unsigned type with a low value.
SUB_OVERFLOW() still doesn't handle all combinations of signed and unsigned types in the parameters.
Fixes: ce0d8e2da340 ("util: add macros for arithmetics with overflow checking") Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
2b304337 |
| 07-May-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
util: fix fallback ADD_OVERFLOW() macro
This only applies when the compiler doesn't provide the __builtin_add_overflow() function (before GCC 5.1).
Fixes problem due to integer promotion in overflo
util: fix fallback ADD_OVERFLOW() macro
This only applies when the compiler doesn't provide the __builtin_add_overflow() function (before GCC 5.1).
Fixes problem due to integer promotion in overflow macros when result is a signed type and the second addend is an unsigned type with value 0.
ADD_OVERFLOW() still doesn't handle all combinations of signed and unsigned types in the parameters.
Fixes: ce0d8e2da340 ("util: add macros for arithmetics with overflow checking") 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 ...
|
| #
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 ...
|
| #
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 ...
|
| #
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 ...
|
| #
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 ...
|
| #
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 ...
|
| #
b18dfc62 |
| 30-Aug-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add .early_bss section
Adds .early_bss to be used for variables that would normally land in .bss, but must not since they are updated before .bss is cleared. This section replaces earlier work
core: add .early_bss section
Adds .early_bss to be used for variables that would normally land in .bss, but must not since they are updated before .bss is cleared. This section replaces earlier workarounds using __data for such variables.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
a681faba |
| 02-Sep-2016 |
Jerome Forissier <jerome.forissier@linaro.org> |
trace.h: add macros to unwind and print the call stack (kernel only)
Adds [EIDF]PRINT_STACK() for debugging purposes. Depends on CFG_CORE_UNWIND=y. As a side-effect, also adds a few things that may
trace.h: add macros to unwind and print the call stack (kernel only)
Adds [EIDF]PRINT_STACK() for debugging purposes. Depends on CFG_CORE_UNWIND=y. As a side-effect, also adds a few things that may be useful on their own: __always_inline, read_pc(), read_fp(), read_lr().
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
34ecdc38 |
| 08-Apr-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
compiler.h add __compiler_bswap{16,32,64) macros
Defines __compiler_bswap64, __compiler_bswap32, __compiler_bswap16 macros with corresponding buildin functions
Reviewed-by: Pascal Brand <pascal.bra
compiler.h add __compiler_bswap{16,32,64) macros
Defines __compiler_bswap64, __compiler_bswap32, __compiler_bswap16 macros with corresponding buildin functions
Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
3276098d |
| 03-Feb-2016 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: introduce __maybe_unused
When a variable, parameter or function may or may not be referenced depending on some conditional compilation setting, mark it with __maybe_unused instead of __unused.
core: introduce __maybe_unused
When a variable, parameter or function may or may not be referenced depending on some conditional compilation setting, mark it with __maybe_unused instead of __unused. The goal is to improve code legibility.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
show more ...
|
| #
4aeff297 |
| 16-Dec-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
Add __rodata_unpaged macro
Adds a __rodata_unpaged macro that will put the object in the unpaged rodata section.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Signed-off-by: Jens Wiklander <jen
Add __rodata_unpaged macro
Adds a __rodata_unpaged macro that will put the object in the unpaged rodata section.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| #
e997afab |
| 13-Jan-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
compiler.h: add section macros
Adds convenience macros to supply the section attribute.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@lin
compiler.h: add section macros
Adds convenience macros to supply the section attribute.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
show more ...
|
| #
525a1f23 |
| 26-Jun-2014 |
Jens Wiklander <jens.wiklander@linaro.org> |
Fix warning in sta_helloworld
* Fixes a couple of printf warnings visible on higher log levels. * Cleans up core/arch/arm32/sta/sub.mk * Adds a compiler.h to provide the __unused macro to avoid warn
Fix warning in sta_helloworld
* Fixes a couple of printf warnings visible on higher log levels. * Cleans up core/arch/arm32/sta/sub.mk * Adds a compiler.h to provide the __unused macro to avoid warnings about unused parameters.
show more ...
|