| 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 ...
|
| b7f0111d | 26-Jan-2018 |
Volodymyr Babchuk <vlad.babchuk@gmail.com> |
bget: use struct bpoolset instead of global variables
Move all global variables that are used by bget into struct bpoolset. "poolset" choosed because term "pool" already used by bget itself. bget ca
bget: use struct bpoolset instead of global variables
Move all global variables that are used by bget into struct bpoolset. "poolset" choosed because term "pool" already used by bget itself. bget can use multiple pools to allocate memory. Now it is posible to use number of pool sets simultaneosly.
Such feature is needed for virtualization support, because we want to use separate allocator for OP-TEE kernel memory allocations and separate allocator for client memory allocations.
Signed-off-by: Volodymyr Babchuk <vlad.babchuk@gmail.com> 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 ...
|
| 1e24465f | 14-Nov-2017 |
Volodymyr Babchuk <vlad.babchuk@gmail.com> |
optee: use correct type to hold exceptions state
cpu_spin_lock_xsave() returns exceptions state in uin32_t, not in unsigned int.
Signed-off-by: Volodymyr Babchuk <vlad.babchuk@gmail.com> Reviewed-b
optee: use correct type to hold exceptions state
cpu_spin_lock_xsave() returns exceptions state in uin32_t, not in unsigned int.
Signed-off-by: Volodymyr Babchuk <vlad.babchuk@gmail.com> Reviewed-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> |
| e103c301 | 11-Sep-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: malloc: use asan_memset_unchecked()
The malloc implementation uses the new asan_memset_unchecked() function internally instead of memset() to avoid unexpected asserts when the address sani
libutils: malloc: use asan_memset_unchecked()
The malloc implementation uses the new asan_memset_unchecked() function internally instead of memset() to avoid unexpected asserts when the address sanitizer is enabled.
bget() tags the requested amount of memory allocated, but eventual padding etc isn't tagged so writes there from instrumented functions, for instance the normal memset(), will be caught.
Reviewed-by: Etienne Carriere <etienne.carriere@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 ...
|
| e84e1fec | 22-Aug-2017 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: clean and unwind arm32_aeabi_[l]divmod_a32.S
Division support can be used in kernel land and user land. Kernel land already support unwind on assembly (kernel/unwind.h) but userland do not. Fo
core: clean and unwind arm32_aeabi_[l]divmod_a32.S
Division support can be used in kernel land and user land. Kernel land already support unwind on assembly (kernel/unwind.h) but userland do not. For simplicity of the userland part, simply define local macros to support unwind in both conditions.
Clean ldivmod from locally defined macros already provided by arm.S.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@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 ...
|
| dc454609 | 17-Aug-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
libutee: provide an implementation of putchar()
Calling printf() from a TA to print a single character results in a linker error:
39 TEE_Result TA_CreateEntryPoint(void) 40 { 41 pr
libutee: provide an implementation of putchar()
Calling printf() from a TA to print a single character results in a linker error:
39 TEE_Result TA_CreateEntryPoint(void) 40 { 41 printf("."); 42 /* ... */ 43 }
hello_world_ta.o: In function `TA_CreateEntryPoint': hello_world_ta.c:41: undefined reference to `putchar'
In this case, the compiler has optimized the printf() call into a call to putchar(), assuming that we have a C library and that it complies to the relevant standards (so that printf() and putchar() may be used interchangeably).
One way to fix the issue is to prevent such optimizations by using -fno-builtin or -ffreestanding, at the cost of slightly larger code size and possibly reduced performance.
Another option is to simply provide the missing putchar() function. It is the purpose of this commit.
Reported-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 ...
|
| 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 ...
|
| ba6d8df9 | 24-May-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: sparse fix: DETECTNULL() macro
Fixes the DETECTNULL() macro used in certain functions imported from newlib.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jens Wik
libutils: sparse fix: DETECTNULL() macro
Fixes the DETECTNULL() macro used in certain functions imported from newlib.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (Juno) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| a3c08883 | 24-May-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
Sparse fix: _assert_break()
Moves the __noreturn attribute for declaration of _assert_break() to before the function name instead which enables sparse to recognize the attribute properly.
Reviewed-
Sparse fix: _assert_break()
Moves the __noreturn attribute for declaration of _assert_break() to before the function name instead which enables sparse to recognize the attribute properly.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 2fa93c74 | 24-May-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
Sparse fix: setjmp.h
Fixes all sparse warnings in setjmp.h
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> |
| 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 ...
|