| a94eb7ef | 15-May-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
util: remove unused macros
After commit 9a8117de1263 ("util: update fallback ADD_OVERFLOW() macro") and commit ecdedc94e720 ("util: update fallback SUB_OVERFLOW() macro"), the following macros are n
util: remove unused macros
After commit 9a8117de1263 ("util: update fallback ADD_OVERFLOW() macro") and commit ecdedc94e720 ("util: update fallback SUB_OVERFLOW() macro"), the following macros are not used anymore. Remove them.
__INTOF_HALF_MAX_SIGNED(type) __INTOF_MAX_SIGNED(type) __INTOF_MIN_SIGNED(type) __INTOF_MIN(type) __INTOF_MAX(type)
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 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 ...
|
| 2770e242 | 14-May-2018 |
Etienne Carriere <etienne.carriere@linaro.org> |
libutils: MIN/MAX macros for assembly code
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> |
| 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 ...
|
| fb30cafd | 27-Apr-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
Prevent unused warnings in speculation_barrier.h
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Joakim Bech <joakim.b
Prevent unused warnings in speculation_barrier.h
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| 6aca2c8e | 27-Apr-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
libutils: import speculation_barrier.h
Import speculation_barrier.h from [1]. This file implements a set of wrapper macros for the __builtin_load_no_speculate builtin function detailed at [2]. This
libutils: import speculation_barrier.h
Import speculation_barrier.h from [1]. This file implements a set of wrapper macros for the __builtin_load_no_speculate builtin function detailed at [2]. This builtin function defines a speculation barrier, which can be used to limit the conditions under which a value which has been loaded can be used under specualtive execution.
The header file provided here allows a migration path to using the builtin function for users who are unable to immediately upgrade to a compiler which supports the builtin.
(Description taken from the README.md file of the speculation_barrier project by Arm on GitHub [3])
Link: [1] https://raw.githubusercontent.com/ARM-software/speculation-barrier/80e65cd830b321ff676941c2fab773da450e6dae/speculation_barrier.h Link: [2] https://www.arm.com/security-update Link: [3] https://github.com/ARM-software/speculation-barrier Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| 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 ...
|
| 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 ...
|
| 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 ...
|