| f6d80bd6 | 30-Mar-2015 |
Pascal Brand <pascal.brand.com> |
Stats on allocation
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne CARRIERE <etienne.carriere@st.com> Tested-by: Etienne CARRIERE <etienne.carriere@st.com> Reviewed-by:
Stats on allocation
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne CARRIERE <etienne.carriere@st.com> Tested-by: Etienne CARRIERE <etienne.carriere@st.com> Reviewed-by: Pascal BRAND <pascal.brand@st.com> Signed-off-by: Pascal Brand <pascal.brand@st.com>
show more ...
|
| fce4cfa1 | 10-Dec-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: provide aeabi functions using softfloat
Configures Softfloat to be used with aeabi function to provide floating point support for user TAs. CFG_TA_FLOAT_SUPPORT is set to y for arm32 platf
libutils: provide aeabi functions using softfloat
Configures Softfloat to be used with aeabi function to provide floating point support for user TAs. CFG_TA_FLOAT_SUPPORT is set to y for arm32 platforms to indicate that floating support is enabled.
Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 9403c583 | 10-Dec-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
Import Softfloat 3a
Imports Softfloat 3a by unzipping it into lib/libutils/isoc/arch/arm/softfloat and converts all dos line endings without any further changes.
Reviewed-by: Pascal Brand <pascal.b
Import Softfloat 3a
Imports Softfloat 3a by unzipping it into lib/libutils/isoc/arch/arm/softfloat and converts all dos line endings without any further changes.
Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b5fed1a5 | 10-Dec-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: add aeabi functions for 64-bit shifting
Adds __aeabi_llsl and __aeabi_llsr to support 64-bit shifting.
Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Signed-off-by: Jens Wiklander <j
libutils: add aeabi functions for 64-bit shifting
Adds __aeabi_llsl and __aeabi_llsr to support 64-bit shifting.
Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 4c1908d3 | 02-Sep-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
stdint.h: add missing least and fast types
Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> |
| ea140671 | 03-Dec-2015 |
Jerome Forissier <jerome.forissier@linaro.org> |
Fix compile error with 64-bit TA dev kit
$ make PLATFORM=hikey CFG_TEE_TA_LOG_LEVEL=2 CFG_ARM64_core=y \ CROSS_COMPILE=arm-linux-gnueabihf- \ CROSS_COMPILE_core=aarch64-linux-gnu- \ CROSS_COMP
Fix compile error with 64-bit TA dev kit
$ make PLATFORM=hikey CFG_TEE_TA_LOG_LEVEL=2 CFG_ARM64_core=y \ CROSS_COMPILE=arm-linux-gnueabihf- \ CROSS_COMPILE_core=aarch64-linux-gnu- \ CROSS_COMPILE_ta_arm64=aarch64-linux-gnu-
lib/libutee/tee_user_mem.c: In function ‘tee_user_mem_status’: lib/libutee/tee_user_mem.c:508:3: error: format ‘%d’ expects argument of type ‘int’, but argument 6 has type ‘size_t’ [-Werror=format=] IMSG("Size:\t[%d]", global_stats.size); ^
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 ...
|
| 156fe685 | 03-Dec-2015 |
Pascal Brand <pascal.brand@st.com> |
build: fix definition of MDBG_ENABLE
Note that because of this bug, MDBG_ENABLE was always defined. Now, MDBG_ENABLE is not defined by default.
Reviewed-by: Jerome Forissier <jerome.forissier@linar
build: fix definition of MDBG_ENABLE
Note that because of this bug, MDBG_ENABLE was always defined. Now, MDBG_ENABLE is not defined by default.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Pascal Brand <pascal.brand@linaro.org> (QEMU) Signed-off-by: Pascal Brand <pascal.brand@st.com>
show more ...
|
| 945694b9 | 02-Dec-2015 |
Pascal Brand <pascal.brand@st.com> |
alloc: fix mutex usage
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> |
| 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 ...
|
| bc33bbd9 | 11-Nov-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
Add support to generate multiple TA dev kits
Adds support to generate multiple TA dev kits, one for each word in the variable "ta-targets". ta/ta.mk is included once for each word in "ta-targets" wi
Add support to generate multiple TA dev kits
Adds support to generate multiple TA dev kits, one for each word in the variable "ta-targets". ta/ta.mk is included once for each word in "ta-targets" with the word assigned to "ta-target". This word is the assigned the variable "sm" to allow each "ta-target" to be built as a separate sub-module.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@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 ...
|
| f74a4a2b | 10-Nov-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutee: arm64 syscalls
Adds assembly implementations of arm64 syscalls.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Revie
libutee: arm64 syscalls
Adds assembly implementations of arm64 syscalls.
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 ...
|
| cf48b9ea | 10-Nov-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutee: 64-bit fixes
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org> |
| fc4efaf7 | 10-Nov-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutee: limit TEE_MAX_SVC_ARGS
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org> |
| 2f04385c | 12-Nov-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
Unify TA entry functions
Unifies TA entry function into one entry function.
* Updates TA entry * Update ta_head * Fixes style issues in user_ta_entry.c
Note that this change is not backwards compa
Unify TA entry functions
Unifies TA entry function into one entry function.
* Updates TA entry * Update ta_head * Fixes style issues in user_ta_entry.c
Note that this change is not backwards compatible, TAs needs to be recompiled.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
show more ...
|
| e86f1266 | 05-Nov-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
Make TEE Core TA interaction 64-bit compatible
* Updates TA entry * Update ta_head * Updates the syscall interface * Adds functions to make a short pointer (32-bit uref) from a kernel pointer and
Make TEE Core TA interaction 64-bit compatible
* Updates TA entry * Update ta_head * Updates the syscall interface * Adds functions to make a short pointer (32-bit uref) from a kernel pointer and vice versa
Note that this change is not backwards compatible, TAs needs to be recompiled.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
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 ...
|
| 1051957d | 27-Oct-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: ltc: add lock for memory pool
Adds a recursive lock for the memory pool, allowing only one thread at a time to use the memory pool. This makes a predictable or consistent worst case for memory
core: ltc: add lock for memory pool
Adds a recursive lock for the memory pool, allowing only one thread at a time to use the memory pool. This makes a predictable or consistent worst case for memory pool utilization. It also allows for a controlled way of releasing memory from the pool to the pager when the pool is unused.
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 ...
|
| b66f219b | 26-Oct-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutee: fix cleanup in TEE_AllocateOperation()
Fixes error handling in TEE_AllocateOperation()
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@l
libutee: fix cleanup in TEE_AllocateOperation()
Fixes error handling in TEE_AllocateOperation()
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
show more ...
|
| 94e8a4fc | 26-Oct-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutee: Optionally replace TEE_Panic() with macro
Help debugging by replacing TEE_Panic() with a macro that does an EMSG() and then calls panic function (__TEE_Panic()).
Signed-off-by: Jens Wiklan
libutee: Optionally replace TEE_Panic() with macro
Help debugging by replacing TEE_Panic() with a macro that does an EMSG() and then calls panic function (__TEE_Panic()).
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 ...
|