| b36311ad | 30-Jan-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
libutee: preserve error code when calling TEE_Panic()
On many occasions, libutee calls TEE_Panic(0) to kill a TA. When an error status from a lower layer is available, it is much more helpful to pas
libutee: preserve error code when calling TEE_Panic()
On many occasions, libutee calls TEE_Panic(0) to kill a TA. When an error status from a lower layer is available, it is much more helpful to pass it instead of zero, because the code is shown in the debug traces.
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 ...
|
| bf7a587f | 25-Jan-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
libutee: AES CTS fix
Ad-hoc fix for regressions introduced by [1]. Tested on HiKey using latest optee_test including GlobalPlatform tests (32/64-bit TEE core, 32/64-bit libutee, with/without ARMv8 C
libutee: AES CTS fix
Ad-hoc fix for regressions introduced by [1]. Tested on HiKey using latest optee_test including GlobalPlatform tests (32/64-bit TEE core, 32/64-bit libutee, with/without ARMv8 CE acceleration).
Fixes: b1ecda78bab4 ("libutee: fix off-by-one error in tee_buffer_update()") [1] Fixes: https://github.com/OP-TEE/optee_os/issues/1305 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 883c4be3 | 13-Oct-2016 |
Jerome Forissier <jerome.forissier@linaro.org> |
Add support for user TA profiling with gprof (-pg)
Adds the infrastructure to collect profiling information from Trusted Applications running in user mode and instrumented with -pg. Enable with: CFG
Add support for user TA profiling with gprof (-pg)
Adds the infrastructure to collect profiling information from Trusted Applications running in user mode and instrumented with -pg. Enable with: CFG_TA_GPROF_SUPPORT=y.
Profiling support in itself adds no significant performance overhead. Instrumented applications however may run 1.3x - 2x slower, and have a larger .bss section (+1.36 times .text size for 32-bit TAs, +1.77 times .text size for 64-bit ones).
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (D02 64-bit) Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (QEMU 32-bit) Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| f3bb2312 | 13-Oct-2016 |
Jerome Forissier <jerome.forissier@linaro.org> |
Add options to build user libraries with profiling enabled (-pg)
Set CFG_TA_GPROF=y to build libutee and the user-mode versions of libutils and libmpa with the -pg flag (gprof profiling). This featu
Add options to build user libraries with profiling enabled (-pg)
Set CFG_TA_GPROF=y to build libutee and the user-mode versions of libutils and libmpa with the -pg flag (gprof profiling). This feature depends on TA profiling support in OP-TEE core which will be introduced in a later commit.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b1ecda78 | 20-Jan-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
libutee: fix off-by-one error in tee_buffer_update()
Makes the ROUNDUP() call in the "feeding from src" case consistent with the "feeding from buffer" case a few lines earlier. Without this fix, AES
libutee: fix off-by-one error in tee_buffer_update()
Makes the ROUNDUP() call in the "feeding from src" case consistent with the "feeding from buffer" case a few lines earlier. Without this fix, AES CTR encryption or decryption could fail because update would feed blocks too soon, leaving less than two blocks in the internal buffer thus causing utee_cipher_final() (called from TEE_CipherDoFinal()) to fail and panic the TA.
Fixes: https://github.com/OP-TEE/optee_os/issues/1203 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 090268f5 | 05-Dec-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutee: bugfix srcData == NULL cases
Fixes faulty treatment of srcData == NULL in TEE_CipherUpdate(), TEE_AEUpdate(), TEE_AEEncryptFinal(), TEE_AEDecryptFinal().
Reviewed-by: Jerome Forissier <jer
libutee: bugfix srcData == NULL cases
Fixes faulty treatment of srcData == NULL in TEE_CipherUpdate(), TEE_AEUpdate(), TEE_AEEncryptFinal(), TEE_AEDecryptFinal().
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Guanchao Liang <liang.guanchao@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> [Rebase on top of master] Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 9ac870c9 | 06-Jan-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
Make sure "make clean" removes everything "make" has created under $(O)
"make clean" would leave behind some files and many directories. Fix this by correctly tracking the files and directories crea
Make sure "make clean" removes everything "make" has created under $(O)
"make clean" would leave behind some files and many directories. Fix this by correctly tracking the files and directories created under $(O) during the build process: - Fix incorrect file names in $(cleanfiles) and add a few missing ones. - Introduce a makefile macro: $(cleandirs-for-rmdir), defined in a new file: mk/cleandirs.mk. It returns the list of directories that should be removed, given a list of files. The clean target removes the files, then all the directories in depth- first order. $(O) is also removed, if found to be empty.
Note that a more straightforward approach was discussed in [1]: use "rm -rf $(O)/some_dir" and get rid of the whole file and directory tracking via $(cleanfiles) and $(cleandirs). Although it was agreed it would be safe, doing so would necessarily break the backward compatibility for build scripts relying on "make O=<some path>", due to the additional level ($(O)/some_dir).
Finally, mk/cleandirs.mk is exported to the TA dev kit and the clean rule for the TAs is updated.
[1] https://github.com/OP-TEE/optee_os/pull/1270
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> Acked-by: Andy Green <andy@warmcat.com>
show more ...
|
| c8abbbdb | 06-Dec-2016 |
Volodymyr Babchuk <vlad.babchuk@gmail.com> |
stdint.h: add UINTPTR_C macro
This macro can be used when we want to present value that boths acceptable by C compiller and by ld.
Signed-off-by: Volodymyr Babchuk <vlad.babchuk@gmail.com> Reviewed
stdint.h: add UINTPTR_C macro
This macro can be used when we want to present value that boths acceptable by C compiller and by ld.
Signed-off-by: Volodymyr Babchuk <vlad.babchuk@gmail.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 82c9f597 | 11-Nov-2016 |
Volodymyr Babchuk <vlad.babchuk@gmail.com> |
malloc: use spinlock instead of mutex
Allocation functions are atomic (like linux kernel atomic context), so mutexes are overkill for them. This change will allow use to use allocator in atomic cont
malloc: use spinlock instead of mutex
Allocation functions are atomic (like linux kernel atomic context), so mutexes are overkill for them. This change will allow use to use allocator in atomic contexts like fast SMC calls or IRQ handlers.
Signed-off-by: Volodymyr Babchuk <vlad.babchuk@gmail.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 93091fda | 09-Dec-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
libzlib: suppress gcc6 warnings
Turns off warnings for shifting of negative values (-Wno-shift-negative-value) to silent a warning for "-1L << 16".
Reviewed-by: Jerome Forissier <jerome.forissier@l
libzlib: suppress gcc6 warnings
Turns off warnings for shifting of negative values (-Wno-shift-negative-value) to silent a warning for "-1L << 16".
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 59c2b6bf | 08-Dec-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
Format UUID strings correctly
Prior to this patch although GlobalPlatform specifies that TAs and such are identified with UUIDs, we don't format them quite right when turning them into strings. Per
Format UUID strings correctly
Prior to this patch although GlobalPlatform specifies that TAs and such are identified with UUIDs, we don't format them quite right when turning them into strings. Per https://www.ietf.org/rfc/rfc4122.txt, there should be another hyphen after the first two bytes of clockSeqAndNode.
Unfortunately, fixing this breaks compatibility between how TAs are built, and when the OS loads them.
With this patch UUID string are formated with the additional hyphen as for instance: f81d4fae-7dec-11d0-a765-00a0c91e6bf6
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Fixes: https://github.com/OP-TEE/optee_os/issues/857 Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 827308b8 | 25-Nov-2016 |
Jerome Forissier <jerome.forissier@linaro.org> |
libutee: TEE_AEUpdate(): do nothing when (!srcData && !srcLen)
Fixes: Coverity CID:1378615 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@l
libutee: TEE_AEUpdate(): do nothing when (!srcData && !srcLen)
Fixes: Coverity CID:1378615 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| a9f92a95 | 25-Nov-2016 |
Jerome Forissier <jerome.forissier@linaro.org> |
libutee: TEE_AEEncryptFinal(): do nothing when (!srcData && !srcLen)
Fixes: Coverity CID:1378616 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wikla
libutee: TEE_AEEncryptFinal(): do nothing when (!srcData && !srcLen)
Fixes: Coverity CID:1378616 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 2fda30ff | 25-Nov-2016 |
Jerome Forissier <jerome.forissier@linaro.org> |
libutee: TEE_AEDecryptFinal(): do nothing when (!srcData && !srcLen)
Fixes: Coverity CID:1378617 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wikla
libutee: TEE_AEDecryptFinal(): do nothing when (!srcData && !srcLen)
Fixes: Coverity CID:1378617 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 4bd53c54 | 24-Nov-2016 |
Jerome Forissier <jerome.forissier@linaro.org> |
libutee: TEE_AllocateOperation(): rewrite FALLTHROUGH comment
Fixes: Coverity CID:1378629 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@li
libutee: TEE_AllocateOperation(): rewrite FALLTHROUGH comment
Fixes: Coverity CID:1378629 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| f21873cd | 24-Nov-2016 |
Jerome Forissier <jerome.forissier@linaro.org> |
libutee: TEE_CipherDoFinal(): do nothing when (!srcData && !srcLen)
Fixes: Coverity CID:1378631 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklan
libutee: TEE_CipherDoFinal(): do nothing when (!srcData && !srcLen)
Fixes: Coverity CID:1378631 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| e32c5ddf | 24-Nov-2016 |
Jerome Forissier <jerome.forissier@linaro.org> |
libutee: TEE_CipherUpdate(): do nothing when (!srcData && !srcLen)
Fixes: Coverity CID:1378632 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wikland
libutee: TEE_CipherUpdate(): do nothing when (!srcData && !srcLen)
Fixes: Coverity CID:1378632 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b9d8f134 | 24-Nov-2016 |
Jerome Forissier <jerome.forissier@linaro.org> |
libutee: TEE_GetObjectValueAttribute(): 'a' and 'b' may be NULL
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> |
| be96c837 | 24-Nov-2016 |
Jerome Forissier <jerome.forissier@linaro.org> |
libutee: TEE_GetObjectValueAttribute(): copy data on success only
buf[0] and buf[1] can be relied upon only when utee_cryp_obj_get_attr() is successful.
Fixes: Coverity CID:1378646 Signed-off-by: J
libutee: TEE_GetObjectValueAttribute(): copy data on success only
buf[0] and buf[1] can be relied upon only when utee_cryp_obj_get_attr() is successful.
Fixes: Coverity CID:1378646 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| dd3247be | 15-Nov-2016 |
Etienne Carriere <etienne.carriere@linaro.org> |
libutee extension: check-access-right for secure/nonsec permissions
Define TEE_MEMORY_ACCESS_NONSECURE and TEE_MEMORY_ACCESS_SECURE are extensions of the flag bitfield argument of TEE_CheckMemoryAcc
libutee extension: check-access-right for secure/nonsec permissions
Define TEE_MEMORY_ACCESS_NONSECURE and TEE_MEMORY_ACCESS_SECURE are extensions of the flag bitfield argument of TEE_CheckMemoryAccessRights(). Once one of these is set, core checks the secure mapping attribute.
Note: if both are set, it's obviously an caller error. Implementation will return a TEE_ERROR_ACCESS_DENIED.
Include tee_api_defines_extensions.h from tee_internal_api_extensions.h so that TAs only have to include tee_internal_api_extensions.h to access extensions resources.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 68540524 | 02-Nov-2016 |
Igor Opaniuk <igor.opaniuk@linaro.org> |
core/libutee: perform cleanup for magic "4"
Perform cleanup for magic "4" constant that represents amount of tee params
Signed-off-by: Igor Opaniuk <igor.opaniuk@linaro.org> Reviewed-by: Etienne Ca
core/libutee: perform cleanup for magic "4"
Perform cleanup for magic "4" constant that represents amount of tee params
Signed-off-by: Igor Opaniuk <igor.opaniuk@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 4d9c8fe8 | 26-Oct-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutee: remove unused TEE_ERROR_FILE_NOT_FOUND
Removes unused proprietary TEE_Result code TEE_ERROR_FILE_NOT_FOUND.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens
libutee: remove unused TEE_ERROR_FILE_NOT_FOUND
Removes unused proprietary TEE_Result code TEE_ERROR_FILE_NOT_FOUND.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 2ffdd194 | 26-Oct-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
Remove legacy tee_common_unpg.h
Removes legacy file core/include/kernel/tee_common_unpg.h and updates with new types etc as needed.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Teste
Remove legacy tee_common_unpg.h
Removes legacy file core/include/kernel/tee_common_unpg.h and updates with new types etc as needed.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Etienne Carriere <etienne.carriere@linaro.org> (b2260) Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 9102ce21 | 19-Sep-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
syscall storage_obj_seek: fix sign extension
Fixes problem with sign extension (or lack thereof) for the syscall storage_obj_seek. Updates the general rules of arguments for syscalls to use signed 3
syscall storage_obj_seek: fix sign extension
Fixes problem with sign extension (or lack thereof) for the syscall storage_obj_seek. Updates the general rules of arguments for syscalls to use signed 32-bit parameters when a signed parameter is needed.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey) Suggested-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU and FVP) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 52f8b816 | 01-Sep-2016 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: add heap allocation failure statistics
Adds the following statistics to the heap allocator and export then via the static TA `core/arch/arm/sta/stats.c` (all of them can be reset):
- num_all
core: add heap allocation failure statistics
Adds the following statistics to the heap allocator and export then via the static TA `core/arch/arm/sta/stats.c` (all of them can be reset):
- num_alloc_fail: number of calls to malloc()/calloc()/realloc() that returned NULL - biggest_alloc_fail: the size in bytes of the largest allocation request that resulted in a failure - biggest_alloc_fail_used: the number of bytes that were allocated at that time
Depends on CFG_WITH_STATS=y.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|