| 57aabac5 | 02-Jun-2017 |
Bogdan Liulko <bogdan.liulko@globallogic.com> |
Remove buffering for AES CTR
CTR mode of AES algorithm turns block cipher into stream cipher. It means that input data can has any size independent from block size. It must be processed and result c
Remove buffering for AES CTR
CTR mode of AES algorithm turns block cipher into stream cipher. It means that input data can has any size independent from block size. It must be processed and result ciphertext must be generated after each TEE_CipherUpdate function call. That is why it is incorrect to apply for AES CTR the input buffering on TEE_CipherUpdate call when size is not multiple of block size.
Signed-off-by: Bogdan Liulko <bogdan.liulko@globallogic.com> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey) Tested-by: Bogdan Liulko <bogdan.liulko@globallogic.com> (R-Car) Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| afc0c182 | 31-May-2017 |
Bogdan Liulko <bogdan.liulko@globallogic.com> |
libutee: Remove buffering for AES GCM
GCM mode of AES algorithm is essentially a stream cipher. It means that there is no requirements for input data size related to block size. And every time when
libutee: Remove buffering for AES GCM
GCM mode of AES algorithm is essentially a stream cipher. It means that there is no requirements for input data size related to block size. And every time when AEUpdate is called input data must be processed and output immediately generated. That is why it is incorrect to apply for AES GCM the input buffering on AEUpdate call when size is not multiple of block size.
Signed-off-by: Bogdan Liulko <bogdan.liulko@globallogic.com> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey) Tested-by: Bogdan Liulko <bogdan.liulko@globallogic.com> (R-Car) Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| d5b65f30 | 09-Nov-2016 |
Igor Opaniuk <igor.opaniuk@linaro.org> |
OP-TEE Benchmark
OP-TEE Benchmark feature provides timestamp data for the roundtrip time from libteec to OP-TEE OS core.
Benchmark PTA handles registration/unregistration commands of timestamp buff
OP-TEE Benchmark
OP-TEE Benchmark feature provides timestamp data for the roundtrip time from libteec to OP-TEE OS core.
Benchmark PTA handles registration/unregistration commands of timestamp buffer, invoked by optee_benchmark NW application, and performs registration of timestamp buffer in the linux kernel optee driver via RPC call.
To enable this feature set CFG_TEE_BENCHMARK compile flag to "y".
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Igor Opaniuk <igor.opaniuk@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 ...
|
| ce0d8e2d | 22-May-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
util: add macros for arithmetics with overflow checking
Compiler builtin support for checking overflow of addition, subtraction and multiplication is used if available. If unavailable a fallback imp
util: add macros for arithmetics with overflow checking
Compiler builtin support for checking overflow of addition, subtraction and multiplication is used if available. If unavailable a fallback implementation using macros is used instead.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey 32/64) Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 31a29642 | 11-May-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: dump call stack of user TAs on abort
Update the abort handling code in the TEE core to support unwinding the user mode stack in addition to the kernel stack. unwind_arm32.c is modified slightl
core: dump call stack of user TAs on abort
Update the abort handling code in the TEE core to support unwinding the user mode stack in addition to the kernel stack. unwind_arm32.c is modified slightly so that it can be built for AArch64. This allows a 64-bit TEE core to dump both 32- and 64-bit TAs.
Paged TAs (CFG_PAGED_USER_TA=y) cannot currently be unwound, because the code is not ready to handle the page faults that might occur as the unwinding tables are accessed.
CFG_CORE_UNWIND is renamed to CFG_UNWIND since it enables both the kernel and user TA stack dumps. It is still set automatically when CFG_TEE_CORE_DEBUG=y.
32-bit user TAs have to be compiled with `-funwind-tables`, otherwise the call stack can't be unwound and the abort reports will not show a call stack .The TA dev kit takes care of adding this flag automatically when CFG_UNWIND=y.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey) Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 63988d7c | 09-May-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
Fix ROUNDUP()/ROUNDDOWN() macros
Fixes the ROUNDUP()/ROUNDDOWN() macros to mask internally with a bitmask that is of the same size as the value that is to be rounded. Without this patch the mask use
Fix ROUNDUP()/ROUNDDOWN() macros
Fixes the ROUNDUP()/ROUNDDOWN() macros to mask internally with a bitmask that is of the same size as the value that is to be rounded. Without this patch the mask uses the size of the type of the @size parameter, which can differ and give wrong result.
Reported-by: Zhizhou Zhang <zhizhouzhang@asrmicro.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 455856d4 | 19-Apr-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
Remove SQL-FS
With recent developments in REE-FS SQL-FS has become redundant. This patch removes SQL-FS.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Acked-by: Jerome Forissier <jerome.forissi
Remove SQL-FS
With recent developments in REE-FS SQL-FS has become redundant. This patch removes SQL-FS.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Acked-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 ...
|
| 40ea51de | 15-Feb-2017 |
Volodymyr Babchuk <vlad.babchuk@gmail.com> |
spinlock: add cpu_spin_lock_xsave()/xrestore() functions
These are functions like spin_lock_irqsave() functions in linux kernel. They should replace xxx_lock() functions in different modules.
Signe
spinlock: add cpu_spin_lock_xsave()/xrestore() functions
These are functions like spin_lock_irqsave() functions in linux kernel. They should replace xxx_lock() functions in different modules.
Signed-off-by: Volodymyr Babchuk <vlad.babchuk@gmail.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 040bc0f0 | 03-Apr-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add test case for hash-tree
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Signed-off-by: Jens Wiklander <jens.wiklander@
core: add test case for hash-tree
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 34e59a23 | 30-Mar-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
tee_internal_api.h: do not define non-standard macros
The macros SLogTrace(), SLogError(), SLogWarning() and S_VAR_NOT_USED() are nowhere mentioned in the GlobalPlatform TEE Internal Core API spec.
tee_internal_api.h: do not define non-standard macros
The macros SLogTrace(), SLogError(), SLogWarning() and S_VAR_NOT_USED() are nowhere mentioned in the GlobalPlatform TEE Internal Core API spec. Delete them.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 620e4edf | 21-Mar-2017 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: export pTA invoke_tests API to ease tests integration
Suggested-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome
core: export pTA invoke_tests API to ease tests integration
Suggested-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| c04e5c1d | 13-Mar-2017 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: introduce TA_FLAG_SECURE_DATA_PATH
Rename TA_FLAG_UNSAFE_NW_PARAMS into TA_FLAG_SECURE_DATA_PATH.
This change does NOT able secure data path support in OP-TEE. It is rather a pre-requisite fo
core: introduce TA_FLAG_SECURE_DATA_PATH
Rename TA_FLAG_UNSAFE_NW_PARAMS into TA_FLAG_SECURE_DATA_PATH.
This change does NOT able secure data path support in OP-TEE. It is rather a pre-requisite for later changes in OP-TEE regarding SDP support.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| f967662d | 02-Mar-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
libutee: demote allocation traces from DEBUG to FLOW
When CFG_TEE_CORE_USER_MEM_DEBUG=1 (which is the default, enables additional checks in tee_user_mem.c and also enables traces) and CFG_TEE_TA_LOG
libutee: demote allocation traces from DEBUG to FLOW
When CFG_TEE_CORE_USER_MEM_DEBUG=1 (which is the default, enables additional checks in tee_user_mem.c and also enables traces) and CFG_TEE_TA_LOG_LEVEL=3 (DEBUG), libutee logs messages for each and every allocation and deallocation, as follows:
DEBUG: USER-TA: tee_user_mem_alloc:343: Allocate: link:[0x1211a0], buf:[0x1211b0:12] DEBUG: USER-TA: tee_user_mem_free:442: Free: link:[0x1211a0], buf:[0x1211b0:12] ...
That's annoying and pretty much useless so let's change them to use the lower TRACE_FLOW level (CFG_TEE_TA_LOG_LEVEL=4) instead.
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 ...
|
| 5acb1bc6 | 12-Dec-2016 |
David Wang <david.wang@arm.com> |
Rename the secure and non-secure interrupts
Currently, the secure interrupts are named as FIQ and the non-secure interrupts are named as IRQ.
In GICv3 mode, the FIQ and IRQ have different definitio
Rename the secure and non-secure interrupts
Currently, the secure interrupts are named as FIQ and the non-secure interrupts are named as IRQ.
In GICv3 mode, the FIQ and IRQ have different definitions. * Secure Group 0 interrupts: Handled by EL3 and triggered by FIQ when running at Secure EL0/1. * Secure Group 1 interrupts: Handled by optee_os and triggered by IRQ when running at Secure EL0/1. * Non-secure Group1 interrupts: Handled by the rich os and triggered by FIQ when running at Secure EL0/1.
The "Secure Group 1" interrupts are the "native" interrupts handled by optee_os. They are same as the "secure" interrupts used in optee_os for now. But they are triggered by FIQ in GICv2 mode while by IRQ in GICv3 mode.
The "Secure Group 0" and "Non-secure Group1" interrupts are the "foreign" interrupts that will cause the exiting of optee_os. (e.g. switch back to normal world) The "Non-secure Group1" interrupts are same as the "non-secure"interrupts used in optee_os for now. But they are triggered by IRQ in GICv2 mode while by FIQ in GICv3 mode.
This patch renames these interrupts to the generic names - "Foreign interrupts" and "Native interrupts". For the support of GICv3 mode in the future, we can redefine the macros of "native interrupt" and "foreign interrupt" to IRQ and FIQ.
Signed-off-by: David Wang <david.wang@arm.com> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Etienne Carriere <etienne.carriere@linaro.org> (b2260)
show more ...
|
| a32a96ed | 13-Dec-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutee: add TEE iSocket interface and implementation
Adds TEE iSocket interface and corresponding user space implementation for TCP and UDP. A pseudo TA is defined for interaction with OP-TEE Core.
libutee: add TEE iSocket interface and implementation
Adds TEE iSocket interface and corresponding user space implementation for TCP and UDP. A pseudo TA is defined for interaction with OP-TEE Core.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 933a11e0 | 19-Dec-2016 |
Andrew F. Davis <afd@ti.com> |
libutils: Add GENMASK_{32,64} helper macros
Allow defining a bitmask using first and last bits.
Signed-off-by: Andrew F. Davis <afd@ti.com> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> |
| 8f07fe6f | 30-Jan-2017 |
Jerome Forissier <jerome.forissier@linaro.org> |
libutee: API: add 'const' qualifiers
As per the GlobalPlatform Internal Core API Specification v1.1, section 3.4 Parameter Annotations: "[...] the [in], [inbuf], [instring], [instringopt], and [ctx]
libutee: API: add 'const' qualifiers
As per the GlobalPlatform Internal Core API Specification v1.1, section 3.4 Parameter Annotations: "[...] the [in], [inbuf], [instring], [instringopt], and [ctx] annotations can make use of the const C keyword [...] the C header file of a compliant Implementation SHOULD use the const keyword when these annotations appear."
Note that the TA entry points: TA_OpenSessionEntryPoint(), TA_CloseSessionEntryPoint() and TA_InvokeCommandEntryPoint() are unchanged to avoid breaking existing code (not worth it).
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 ...
|
| 745fc9b9 | 31-Jan-2017 |
Jens Wiklander <jens.wiklander@linaro.org> |
libmpa: fix undefined left shift
Fixes left shift out of bounds (undefined behavior) in mpa_shift_right().
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander
libmpa: fix undefined left shift
Fixes left shift out of bounds (undefined behavior) in mpa_shift_right().
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 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 ...
|