| d4ce92c3 | 02-Dec-2015 |
Pascal Brand <pascal.brand@st.com> |
alloc: Remove mdbg_mode
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Pascal Brand <pascal.brand@st.com> |
| fe3ccf24 | 30-Nov-2015 |
Jerome Forissier <jerome.forissier@linaro.org> |
libutils: add %pUl format for UUIDs
The debug traces in tee_ta_manager.c do not show the last 8 bytes of the TA UUIDs, which makes the output confusing sometimes. This commit adds support for a new
libutils: add %pUl format for UUIDs
The debug traces in tee_ta_manager.c do not show the last 8 bytes of the TA UUIDs, which makes the output confusing sometimes. This commit adds support for a new printf format for little-endian encoded UUIDs: %pUl, and uses it in tee_ta_manager.c. For example:
TEE_UUID uuid; DMSG("UUID: %pUl", (void *)&uuid);
...will print something like:
[...] UUID: cb3e5ba0-adf1-11e0-998b0002a5d5c51b
The new format is available when using the trace macros or the new functions: snprintk(), vsnprintk() declared in <printk.h>. But, snprintf() and vsnprintf() are not modified in order not to break standard compliance.
This format is taken from the Linux kernel [1].
[1] https://www.kernel.org/doc/Documentation/printk-formats.txt
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 ...
|
| 0fcbddd4 | 11-Nov-2015 |
SY Chiu <sy.chiu@linaro.org> |
debug: enable bget memory leak detection
This patch enables memory leak detection in bget_malloc.c. This is very helpful to find memory leakage issue in teecore or user TA. To enable it in teecore,
debug: enable bget memory leak detection
This patch enables memory leak detection in bget_malloc.c. This is very helpful to find memory leakage issue in teecore or user TA. To enable it in teecore, build optee_os with `CFG_TEE_CORE_MALLOC_DEBUG=y`. For user TA, build optee_os with `CFG_TEE_TA_MALLOC_DEBUG=y`.
Then, add the following statement at some point of your code that might frequently been triggered:
mdbg_check(1);
It will dump allocated memory blocks and the holders of them. If you find a memory block appears multiple times after the system runs a period of time, it is very likely the source of memory leakage.
Here is an example output:
ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 0 bytes core/tee/tee_svc_storage.c:260 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 104 bytes core/tee/tee_svc_storage.c:444 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 18 bytes core/tee/tee_pobj.c:119 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 56 bytes core/tee/tee_pobj.c:110 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 192 bytes core/arch/arm/mm/tee_mmu.c:93 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 32 bytes core/arch/arm/mm/tee_mmu.c:241 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 24 bytes core/arch/arm/mm/tee_mm.c:75 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 24 bytes core/arch/arm/mm/tee_mm.c:75 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 224 bytes core/arch/arm/kernel/tee_ta_manager.c:573 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 72 bytes core/arch/arm/kernel/tee_ta_manager.c:1202 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 7 bytes lib/libutils/isoc/strdup.c:34 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 7 bytes lib/libutils/isoc/strdup.c:34 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 7 bytes lib/libutils/isoc/strdup.c:34 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 7 bytes lib/libutils/isoc/strdup.c:34 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 32 bytes core/kernel/handle.c:70 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 24 bytes core/arch/arm/mm/tee_mm.c:48 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 24 bytes core/arch/arm/mm/tee_mm.c:48 ERR TEE-CORE:mdbg_check:720: Orphaned buffer: 24 bytes core/arch/arm/mm/tee_mm.c:48 ERR TEE-CORE:mdbg_check:720: Ignore buffer: 16 bytes lib/libutils/isoc/bget_malloc.c:794
You can see the buffer hold by strdup.c:34 appears 4 times, so it's very likely to be the source of memory leakage.
Signed-off-by: SY Chiu <sy.chiu@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey) Tested-by: SY Chiu <sy.chiu@linaro.org> (MT8173 EVB)
show more ...
|
| c4553de7 | 25-Nov-2015 |
Jerome Forissier <jerome.forissier@linaro.org> |
Make compilation of lib/libutils/isoc configurable again
Commit c3e0bd74e4cf ("Delete libutil_with_isoc") wrongly assumed that the code in lib/libutils/isoc is mandatory for any OP-TEE build. This i
Make compilation of lib/libutils/isoc configurable again
Commit c3e0bd74e4cf ("Delete libutil_with_isoc") wrongly assumed that the code in lib/libutils/isoc is mandatory for any OP-TEE build. This is not true for some non-upstream platforms which can find the functions in external libraries.
Therefore, this commits makes the thing configurable again through CFG_LIBUTILS_WITH_ISOC (default: y).
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reported-by: Pascal Brand <pascal.brand@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 80ddeac7 | 06-Nov-2015 |
Jerome Forissier <jerome.forissier@linaro.org> |
Add ALIGNMENT_IS_OK to libutils/ext/include/util.h, delete unused code
TEE_ALIGNMENT_IS_OK() is renamed ALIGNMENT_IS_OK() and moved to lib/libutils/ext/include/util.h, which avoids duplication (was
Add ALIGNMENT_IS_OK to libutils/ext/include/util.h, delete unused code
TEE_ALIGNMENT_IS_OK() is renamed ALIGNMENT_IS_OK() and moved to lib/libutils/ext/include/util.h, which avoids duplication (was previously in core/include/kernel/tee_common_unpg.h and lib/libutee/include/utee_defines.h). Call sites are adjusted accordingly.
It is assumed that the compiler keyword __alignof__ is available, so CFG_TC_NO_ALIGNOF is of no use. We also remove unused definitions: TEE_ALIGNMENT_*B_IS_OK().
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 ...
|
| 45082335 | 30-Oct-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: make malloc thread-safe
Makes malloc family of functions thread-safe by using an internal mutex when compiled to be used in TEE Core.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.
libutils: make malloc thread-safe
Makes malloc family of functions thread-safe by using an internal mutex when compiled to be used in TEE Core.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| bf50df8b | 04-Nov-2015 |
Jerome Forissier <jerome.forissier@linaro.org> |
DHEXDUMP(): prefix each line with the current address in the buffer
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by:
DHEXDUMP(): prefix each line with the current address in the buffer
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| c3e0bd74 | 02-Nov-2015 |
Jerome Forissier <jerome.forissier@linaro.org> |
Delete libutil_with_isoc
OP-TEE won't build unless $(libutil_with_isoc) is 'y', so this variable is not needed.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Joakim Bec
Delete libutil_with_isoc
OP-TEE won't build unless $(libutil_with_isoc) is 'y', so this variable is not needed.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| bfc6487b | 10-Sep-2015 |
Jerome Forissier <jerome.forissier@linaro.org> |
Flush traces synchronously
Avoids random mixing of secure world traces with ones from the normal world (assuming the normal world also flushes its debug traces synchronously).
The 'sync' parameter
Flush traces synchronously
Avoids random mixing of secure world traces with ones from the normal world (assuming the normal world also flushes its debug traces synchronously).
The 'sync' parameter to the trace_printf() and trace_ext_puts() function is removed because there seems to be no sensible use case mandating sync == false.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| f4c0a293 | 23-Jun-2015 |
SY Chiu <sy.chiu@linaro.org> |
Secure Storage: Implemented atomic operations
The following operations should be atomic:
- Write - Rename - Create/Delete - Truncate
Signed-off-by: SY Chiu <sy.chiu@linaro.org> Tested-by: SY Chiu
Secure Storage: Implemented atomic operations
The following operations should be atomic:
- Write - Rename - Create/Delete - Truncate
Signed-off-by: SY Chiu <sy.chiu@linaro.org> Tested-by: SY Chiu <sy.chiu@linaro.org> (QEMU) Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| 78239609 | 25-Aug-2015 |
Pascal Brand <pascal.brand@st.com> |
Fix leaking information from mem_neq
This fix comes from https://github.com/libtom/libtomcrypt/issues/74 mem_neq is a constant time comparison function, but it leaks information on the secre
Fix leaking information from mem_neq
This fix comes from https://github.com/libtom/libtomcrypt/issues/74 mem_neq is a constant time comparison function, but it leaks information on the secret data that is being compared in the value that is returned.
Signed-off-by: Pascal Brand <pascal.brand@st.com> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Pascal Brand <pascal.brand@linaro.org> (QEMU)
show more ...
|
| 4a9bd0a7 | 09-Jul-2015 |
Paul Swan <Paul.Swan@microsoft.com> |
Remove the duplicate definition of ssize_t to instead use a single definition. Building OpenSSL as part of a TA resulted in both being included causing a build break.
Signed-off-by: Paul Swan <paswa
Remove the duplicate definition of ssize_t to instead use a single definition. Building OpenSSL as part of a TA resulted in both being included causing a build break.
Signed-off-by: Paul Swan <paswan@microsoft.com> Reviewed-by: Youssef Esmat <Youssef.Esmat@microsoft.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| ab35d7ad | 28-Apr-2015 |
Cedric Chaumont <cedric.chaumont@st.com> |
GP Internal Core API v1.1 : TEE configuration properties
Signed-off-by: Cedric Chaumont <cedric.chaumont@st.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier
GP Internal Core API v1.1 : TEE configuration properties
Signed-off-by: Cedric Chaumont <cedric.chaumont@st.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Tested-by: Cedric Chaumont <cedric.chaumont@linaro.org> (STM boards) Tested-by: Cedric Chaumont <cedric.chaumont@linaro.org> (ARM Juno board)
show more ...
|
| 31908aea | 28-Apr-2015 |
Pascal Brand <pascal.brand@st.com> |
s/CFG_TEE_FW_DEBUG/CFG_TEE_CORE_DEBUG
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Pascal Brand <pascal.brand@st.com> |
| abe38974 | 09-Mar-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
Rename arm32 architecture to arm
Renames arm32 directories to arm.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Reviewed-by
Rename arm32 architecture to arm
Renames arm32 directories to arm.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Tested-by: Pascal Brand <pascal.brand@linaro.org> (QEMU platform)
show more ...
|
| 6c209a3c | 19-Mar-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: make bget 64bit ready
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU, FVP) Reviewed-by: Pascal Brand <pascal.brand@li
libutils: make bget 64bit ready
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU, FVP) Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Tested-by: Pascal Brand <pascal.brand@linaro.org> (STM platform)
show more ...
|
| 1f60363a | 19-Mar-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
select base types based on ILP32 and LP64 defines
* Selects base types base on the __ILP32__ and __LP64__ defines * Fixes warnings from change of base types
Signed-off-by: Jens Wiklander <jens.wikl
select base types based on ILP32 and LP64 defines
* Selects base types base on the __ILP32__ and __LP64__ defines * Fixes warnings from change of base types
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
show more ...
|
| 8a1e7b89 | 30-Mar-2015 |
Jerome Forissier <jerome.forissier@linaro.org> |
Rename CFG_TRACE_LEVEL to TRACE_LEVEL
The trace level macro is not meant to be configured directly, it takes its value from CFG_TEE_CORE_LOG_LEVEL (when the TEE core is compiled) or from CFG_TEE_TA_
Rename CFG_TRACE_LEVEL to TRACE_LEVEL
The trace level macro is not meant to be configured directly, it takes its value from CFG_TEE_CORE_LOG_LEVEL (when the TEE core is compiled) or from CFG_TEE_TA_LOG_LEVEL (when user libraries are compiled). Therefore it should not have a CFG_ prefix.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| cf458f13 | 19-Mar-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: rename aeabi files
Renames aeabi files to reflect the processor mode (ARM32) and instruction set used in assembly files (A32).
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Te
libutils: rename aeabi files
Renames aeabi files to reflect the processor mode (ARM32) and instruction set used in assembly files (A32).
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
show more ...
|
| 5ee223c5 | 04-Feb-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
types_ext.h: add PRI* macros
* Adds PRIxVA and PRIxPA macros to types.h. * Includes inttypes.h instead of stdint.h to make all PRI* macros available when including this file.
Signed-off-by: Jens
types_ext.h: add PRI* macros
* Adds PRIxVA and PRIxPA macros to types.h. * Includes inttypes.h instead of stdint.h to make all PRI* macros available when including this file.
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 ...
|
| 0e91d797 | 30-Jan-2015 |
Jean-Michel Delorme <jean-michel.delorme@st.com> |
Fix user TA trace issue
Definition of the global "trace_level" variable has been moved from the libutil to a TA file (user_ta_header.c). This allows to initialize it with the correct value/level CFG
Fix user TA trace issue
Definition of the global "trace_level" variable has been moved from the libutil to a TA file (user_ta_header.c). This allows to initialize it with the correct value/level CFG_TEE_TA_LOG_LEVEL when the TA code is compiled. Same trace level is now applied at all TA code and associated libraries: libutee/libutils/libmpa.
Change-Id: Id6bda7f0611f78fe7ad3ee6b61193f4b80aba94d Signed-off-by: Jean-Michel Delorme <jean-michel.delorme@st.com> Reviewed-on: https://gerrit.st.com/22472 Reviewed-by: Emmanuel MICHEL <emmanuel.michel@st.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Pascal Brand <pascal.brand@linaro.org> (STM platform)
show more ...
|
| fc26c92a | 16-Jan-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
util.h: add parentheses in ROUND{UP,DOWN} macros
Adds parentheses in ROUND{UP,DOWN} macros in util.h and removes ROUND{UP,DOWN} and MIN/MAX macros from utee_defines.h as they are redundant.
Signed-
util.h: add parentheses in ROUND{UP,DOWN} macros
Adds parentheses in ROUND{UP,DOWN} macros in util.h and removes ROUND{UP,DOWN} and MIN/MAX macros from utee_defines.h as they are redundant.
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 ...
|
| d8516202 | 02-Jan-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
snprintf: add 64bit support
* Adds AEABI support for 64-bit division * Updates snprintf.c from a more resent version of subr_prf.c from NetBSD
Signed-off-by: Jens Wiklander <jens.wiklander@linaro
snprintf: add 64bit support
* Adds AEABI support for 64-bit division * Updates snprintf.c from a more resent version of subr_prf.c from NetBSD
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 ...
|
| 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 ...
|
| e5dc28cc | 28-Nov-2014 |
Pascal Brand <pascal.brand@st.com> |
Keep binary compatilities TEECore <--> TA
In case the core is compiled with CFG_TEE_TA_LOG_LEVEL=0 then TA cannot be compiled with CFG_TEE_TA_LOG_LEVEL!=0 because of the trace function.
This pa
Keep binary compatilities TEECore <--> TA
In case the core is compiled with CFG_TEE_TA_LOG_LEVEL=0 then TA cannot be compiled with CFG_TEE_TA_LOG_LEVEL!=0 because of the trace function.
This patch implements stub trace functions in case of unsufficient trace level. It also check - TRACE_LEVEL < 0 instead of TRACE_LEVEL == 0 - TRACE_LEVEL >= 0 instead of TRACE_LEVEL != 0 to take into account negative trae levels
Change-Id: I7b4d2d576c50e103d9cf6f5b22f9f99a1ab96d6a Signed-off-by: Pascal Brand <pascal.brand@st.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|