| f0ef3bea | 26-Apr-2022 |
Sumit Garg <sumit.garg@linaro.org> |
ftrace: Refactor ftrace buffer dump implementation
Current implementation does a lot of tricky bits with ftrace buffer pointer. It also leads to false positive -Warray-bounds warnings with GCC 11.2
ftrace: Refactor ftrace buffer dump implementation
Current implementation does a lot of tricky bits with ftrace buffer pointer. It also leads to false positive -Warray-bounds warnings with GCC 11.2 toolchain as well. So refactor it to use array indexes instead. Also, move hardcoded ftrace line sizes to macros instead for better understanding.
Signed-off-by: Sumit Garg <sumit.garg@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (vexpress-qemu_armv8a)
show more ...
|
| 487f8cd2 | 01-Feb-2022 |
Jerome Forissier <jerome@forissier.org> |
core: compiler.h: introduce __relrodata_unpaged(x)
Introduce macro __relrodata_unpaged(x) to mark data that need to be unpaged and are essentially read-only but may contain relocations when ASLR is
core: compiler.h: introduce __relrodata_unpaged(x)
Introduce macro __relrodata_unpaged(x) to mark data that need to be unpaged and are essentially read-only but may contain relocations when ASLR is enabled, hence "relocatable read-only". When ASLR is turned off, the macro is identical to __rodata_unpaged(x). When ASLR is on however, the data is emitted in section .data.rel.ro.__unpaged.x which is later gathered by the linker file into the output section .data.rel.ro which is mapped read only at runtime (after relocations are processed) and is also unpaged (when pager is enabled).
Signed-off-by: Jerome Forissier <jerome@forissier.org> Acked-by: Sumit Garg <sumit.garg@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 4516e38d | 14-Feb-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
assert.h: add static_assert
Adds the static_assert macro from C11.
Acked-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens W
assert.h: add static_assert
Adds the static_assert macro from C11.
Acked-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 7124d497 | 28-Dec-2021 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
lib: libutils: compiler.h: set trailing comment according to target
In GNU assembler the comment character is target specific. GNU AS for risc-v complains about '/' not recognized as character, ther
lib: libutils: compiler.h: set trailing comment according to target
In GNU assembler the comment character is target specific. GNU AS for risc-v complains about '/' not recognized as character, therefore, replace it with '#' to avoid errors.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| a51d45b5 | 17-Dec-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: mempool based raw malloc functions
Instead of the old stack like internal memory allocator, use the raw malloc functions instead for more efficient memory usage.
CFG_WITH_STATS is enabled
libutils: mempool based raw malloc functions
Instead of the old stack like internal memory allocator, use the raw malloc functions instead for more efficient memory usage.
CFG_WITH_STATS is enabled automatically if CFG_MEMPOOL_REPORT_LAST_OFFSET is enabled to secure a new dependency in the code.
Acked-by: Sahil Malhotra <sahil.malhotra@nxp.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 181f8492 | 06-Dec-2021 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
Generate ELF Note for BTI in all arm64 asm files
Add program property note section in the assembly files to ensure that when linking them, program property note section is generated in the final ELF
Generate ELF Note for BTI in all arm64 asm files
Add program property note section in the assembly files to ensure that when linking them, program property note section is generated in the final ELF.
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 03bada66 | 19-Nov-2021 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
libutils: asm.S : Introduce parameter _bti in FUNC's
There are few places where the original macros FUNC and LOCAL_FUNC are used to define vector tables or exception vector tables. To take care of s
libutils: asm.S : Introduce parameter _bti in FUNC's
There are few places where the original macros FUNC and LOCAL_FUNC are used to define vector tables or exception vector tables. To take care of such assembly code where BTI is not needed, introduce new parameter _bti. If the _bti passed to the function is not default, don't add BTI launchpad to the function.
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| af432c48 | 02-Nov-2021 |
Ruchika Gupta <ruchika.gupta@linaro.org> |
libutils: asm.S : Introduce BTI in macros for functions
When the TEE core, TA's or user space libraries are built for BTI, add a BTI landing pad to the start of all functions, ensuring that they are
libutils: asm.S : Introduce BTI in macros for functions
When the TEE core, TA's or user space libraries are built for BTI, add a BTI landing pad to the start of all functions, ensuring that they are BTI safe.
Signed-off-by: Ruchika Gupta <ruchika.gupta@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| d31aa877 | 14-Dec-2021 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
lib: libutils: trace.c: make print_core_id() architecture-independent
The function print_core_id() in is calling architecture-specific routines to retrieve the core id. It is more relevant to create
lib: libutils: trace.c: make print_core_id() architecture-independent
The function print_core_id() in is calling architecture-specific routines to retrieve the core id. It is more relevant to create a new abstract function trace_ext_get_core_id() in lib/libutee/trace_ext.c that needs to be implemented in the architecture-specific code. This is similar to print_thread_id() which calls trace_ext_get_thread_id() implemented in core/arch/arm/kernel/trace_ext.c
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 52c0b45c | 14-Dec-2021 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
lib: libutils: ext: mempool.c: remove unused thread.h
This commit removes thread.h from lib/libutils/ext/mempool.c since it is not used, but also to eliminate the dependency between generic librarie
lib: libutils: ext: mempool.c: remove unused thread.h
This commit removes thread.h from lib/libutils/ext/mempool.c since it is not used, but also to eliminate the dependency between generic libraries code and architecture-specific core functions.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 72b4db64 | 08-Dec-2021 |
Jerome Forissier <jerome@forissier.org> |
libutils: trace: support more than 100 threads and cores
Add code to support printing thread and core number on 3 digits when needed.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed
libutils: trace: support more than 100 threads and cores
Add code to support printing thread and core number on 3 digits when needed.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 6327913c | 08-Dec-2021 |
Jerome Forissier <jerome@forissier.org> |
libutils: trace: fix off-by-one when switching to 2 digits for thread id
Threads are numbered starting from zero so when CFG_NUM_THREADS == 10 the number still fits on one digit. Fix the conditional
libutils: trace: fix off-by-one when switching to 2 digits for thread id
Threads are numbered starting from zero so when CFG_NUM_THREADS == 10 the number still fits on one digit. Fix the conditional in print_thread_id().
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 1b4b9334 | 15-Jun-2021 |
Clément Léger <clement.leger@bootlin.com> |
ext: include: add DIV_ROUND_UP function
Export DIV_ROUND_UP from mbedtls files to be used by clock drivers.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Clément Léger
ext: include: add DIV_ROUND_UP function
Export DIV_ROUND_UP from mbedtls files to be used by clock drivers.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Clément Léger <clement.leger@bootlin.com>
show more ...
|
| be501eb1 | 05-Oct-2021 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
util: rename ALIGNMENT_IS_OK to IS_ALIGNED_WITH_TYPE
Implement the renamed macro using the IS_ALIGNED definition.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Etienne Carrie
util: rename ALIGNMENT_IS_OK to IS_ALIGNED_WITH_TYPE
Implement the renamed macro using the IS_ALIGNED definition.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 6d777f26 | 05-Oct-2021 |
Jorge Ramirez-Ortiz <jorge@foundries.io> |
util: define IS_ALIGNED macro
Keep a single version of the macro definition.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Revi
util: define IS_ALIGNED macro
Keep a single version of the macro definition.
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| e2c577ca | 12-May-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
compiler.h: add __rodata_dummy macro
Adds the macro __rodata_dummy which places a symbol in the section ".rodata.dummy". This macro is intended to be used in the core/arch/arm/kernel/link_dummies_*.
compiler.h: add __rodata_dummy macro
Adds the macro __rodata_dummy which places a symbol in the section ".rodata.dummy". This macro is intended to be used in the core/arch/arm/kernel/link_dummies_*.c files.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 27c64925 | 12-May-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: use separate sections for each __rodata_unpaged variable
Adds a mandatory argument to the macro __rodata_unpaged() to take the name of the variable to put in the unpaged rodata section. This w
core: use separate sections for each __rodata_unpaged variable
Adds a mandatory argument to the macro __rodata_unpaged() to take the name of the variable to put in the unpaged rodata section. This will result in separate sections for each such variable and make it easier to debug the pruning of the dependency tree for unpaged sections.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| c6e827c0 | 25-Feb-2021 |
Jens Wiklander <jens.wiklander@linaro.org> |
Rename to barrier_read_counter_timer()
Renames barrier_read_cntpct() to barrier_read_counter_timer() to use a neutral name for the counter.
With SPMC at S-EL2 OP-TEE will be virtualized and must us
Rename to barrier_read_counter_timer()
Renames barrier_read_cntpct() to barrier_read_counter_timer() to use a neutral name for the counter.
With SPMC at S-EL2 OP-TEE will be virtualized and must use CNTVCT instead of CNTPCT while the old physical OP-TEE must continue to use CNTPCT.
Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 44a8a0cf | 22-Apr-2021 |
Jerome Forissier <jerome@forissier.org> |
libutils: asm.S: introduce WEAK_FUNC
Adds a WEAK_FUNC macro which does the same as FUNC but defines a weak symbol rather than a global one.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Re
libutils: asm.S: introduce WEAK_FUNC
Adds a WEAK_FUNC macro which does the same as FUNC but defines a weak symbol rather than a global one.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 914103c1 | 22-Apr-2021 |
Jerome Forissier <jerome@forissier.org> |
libutils: asm.S: reorder macro definitions
Define function macros first, then data macros. No functional change.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere
libutils: asm.S: reorder macro definitions
Define function macros first, then data macros. No functional change.
Signed-off-by: Jerome Forissier <jerome@forissier.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 1d85a26e | 21-Jan-2021 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
lib: libutils: ext/isoc: sub.mk: make sources path platform generic
The path to platform specific code is hard-coded. This commit changes it to use defined variable. This is helpful in case of porti
lib: libutils: ext/isoc: sub.mk: make sources path platform generic
The path to platform specific code is hard-coded. This commit changes it to use defined variable. This is helpful in case of porting OP-TEE OS to a new architecture such we make maximum reuse of existing sources.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org>
show more ...
|
| 145ae446 | 02-Dec-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
Use barrier_read_cntpct() to read CNTPCT
Arm ARM quite clearly mentions [1] [2] that such reads must be preceded by an ISB to forbid re-ordering.
[1] https://developer.arm.com/documentation/ddi0487
Use barrier_read_cntpct() to read CNTPCT
Arm ARM quite clearly mentions [1] [2] that such reads must be preceded by an ISB to forbid re-ordering.
[1] https://developer.arm.com/documentation/ddi0487/fc/ page D13-2863 "Synchronization requirements for AArch64 System registers" and page G8-6146 "Ordering of reads of System registers". [2] https://developer.arm.com/documentation/ddi0406/cd/ page B3-1441 "Ordering of reads of system control registers"
Reviewed-by: Jerome Forissier <jerome@forissier.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Reported-by: Olivier Deprez <Olivier.Deprez@arm.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 00b3b9a2 | 31-Aug-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add generic struct ts_session
As a step in making room for Secure Partitions (SPs) running at S-EL0 add a Trusted Service (TS) abstraction. Both TAs and SPs is a TS.
Adds the generic struct t
core: add generic struct ts_session
As a step in making room for Secure Partitions (SPs) running at S-EL0 add a Trusted Service (TS) abstraction. Both TAs and SPs is a TS.
Adds the generic struct ts_session. All future sessions structs (currently only struct tee_ta_session exists) should add this struct to allow generic session operations.
With this struct comes new functions replacing previous struct tee_ta_session oriented functions. The following functions are replaced as: tee_ta_get_current_session() -> ts_get_current_session() tee_ta_push_current_session() -> ts_push_current_session() tee_ta_pop_current_session() -> ts_pop_current_session() tee_ta_get_calling_session() -> ts_get_calling_session()
ts_get_current_session() is changed compared to its predecessor to panic() in case of failure to return a valid pointer.
A new function ts_get_current_session_may_fail() is added to handle an eventual case where a return NULL session may be handled.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 762a5553 | 19-Oct-2020 |
Jens Wiklander <jens.wiklander@linaro.org> |
Add alignment parameter to FUNC() and LOCAL_FUNC() macros
Adds a default alignment parameter to FUNC() and LOCAL_FUNC() assembly macros. This is needed since the function macro also sets the sectio
Add alignment parameter to FUNC() and LOCAL_FUNC() macros
Adds a default alignment parameter to FUNC() and LOCAL_FUNC() assembly macros. This is needed since the function macro also sets the section of the function making any alignment directives before the function macro useless.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 36e784f6 | 13-Oct-2020 |
Volodymyr Babchuk <volodymyr_babchuk@epam.com> |
libutils: provide empty __getauxval() implementation
Never version of libgcc are built with LSE implementation in mind. To determine if LSE is available on platform it calls __getauxval(), so in som
libutils: provide empty __getauxval() implementation
Never version of libgcc are built with LSE implementation in mind. To determine if LSE is available on platform it calls __getauxval(), so in some cases we can get undefined reference to __getauxval() error.
Prominent case is libgcc_eh.a library, which is used by C++ TAs. Exception handler depends on atomic operations, so it tries to call init_have_lse_atomics() first. This function in turn calls __getauxval(), which causes linking error.
In the future we can make __getauxval() to return actual platform capabilities.
Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome@forissier.org>
show more ...
|