| 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> |
| 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 ...
|
| 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 ...
|
| 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 ...
|
| 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 ...
|
| 1d171f95 | 30-Aug-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add support for kernel address sanitizer
Adds support for kernel address sanitizer. Currently only for plat-vexpress-qemu_virt.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Tes
core: add support for kernel address sanitizer
Adds support for kernel address sanitizer. Currently only for plat-vexpress-qemu_virt.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU v7) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| a681faba | 02-Sep-2016 |
Jerome Forissier <jerome.forissier@linaro.org> |
trace.h: add macros to unwind and print the call stack (kernel only)
Adds [EIDF]PRINT_STACK() for debugging purposes. Depends on CFG_CORE_UNWIND=y. As a side-effect, also adds a few things that may
trace.h: add macros to unwind and print the call stack (kernel only)
Adds [EIDF]PRINT_STACK() for debugging purposes. Depends on CFG_CORE_UNWIND=y. As a side-effect, also adds a few things that may be useful on their own: __always_inline, read_pc(), read_fp(), read_lr().
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 086a6557 | 30-Aug-2016 |
Jerome Forissier <jerome.forissier@linaro.org> |
libutils: promote mdbg_check() messages to TRACE_INFO from TRACE_DEBUG
The memory tracing feature enabled by CFG_TEE_CORE_MALLOC_DEBUG=y or CFG_TEE_TA_MALLOC_DEBUG=y is quite convenient to track mem
libutils: promote mdbg_check() messages to TRACE_INFO from TRACE_DEBUG
The memory tracing feature enabled by CFG_TEE_CORE_MALLOC_DEBUG=y or CFG_TEE_TA_MALLOC_DEBUG=y is quite convenient to track memory leaks or other shortages. Unfortunately, the allocation summary is dumped with the TRACE_DEBUG severity so it is easily burried in lots of debug output. In addition, tracking memory leaks frequently involves running code in a loop, so that the leak better stands out from other allocations. Doing so with debug logs enabled tends to slow things down more than necessary.
Therefore this commit promotes the mdbg_check() message to TRACE_INFO.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 351ecd11 | 30-Aug-2016 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: fix compile error when CFG_TEE_CORE_MALLOC_DEBUG=y
When CFG_TEE_CORE_MALLOC_DEBUG is enabled, but CFG_TEE_CORE_DEBUG is not, the compiler complains about unused parameters/functions. Fix them
core: fix compile error when CFG_TEE_CORE_MALLOC_DEBUG=y
When CFG_TEE_CORE_MALLOC_DEBUG is enabled, but CFG_TEE_CORE_DEBUG is not, the compiler complains about unused parameters/functions. Fix them by adding __maybe_unused qualifiers.
lib/libutils/isoc/bget_malloc.c: In function ‘assert_header’: lib/libutils/isoc/bget_malloc.c:688:44: error: unused parameter ‘hdr’ [-Werror=unused-parameter] static void assert_header(struct mdbg_hdr *hdr) ^ lib/libutils/isoc/bget_malloc.c: At top level: lib/libutils/isoc/bget_malloc.c:595:16: error: ‘bget_buf_size’ defined but not used [-Werror=unused-function] static bufsize bget_buf_size(void *buf) ^ cc1: all warnings being treated as errors
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 8c9d9445 | 23-Jul-2016 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: review assert and panic traces
Replace few "{ EMSG(...); panic(); }" with "panic(...);".
Disable file/line/func debug traces in panic() logs when CFG_TEE_CORE_DEBUG is disable.
Change __asse
core: review assert and panic traces
Replace few "{ EMSG(...); panic(); }" with "panic(...);".
Disable file/line/func debug traces in panic() logs when CFG_TEE_CORE_DEBUG is disable.
Change __assert_log() uses EMSG_RAW() to no pollute trace with __assert_log() internals (duplicated file/line/func traces).
Change assert() to use a low/high verbosity mode upon CFG_TEE_CORE_DEBUG as panic() does.
Change assert() to also trace the C function where assertion failed.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jen.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Etienne Carriere <etienne.carriere@linaro.org> (QEMU)
show more ...
|
| a8f34e0c | 23-Jul-2016 |
Etienne Carriere <etienne.carriere@linaro.org> |
assert: honor NDEBUG
Macro assert() expands to a no-op when NDEBUG is defined.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jen.wiklander@linaro.org> R
assert: honor NDEBUG
Macro assert() expands to a no-op when NDEBUG is defined.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jen.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Etienne Carriere <etienne.carriere@linaro.org> (QEMU)
show more ...
|
| 5e7638a8 | 29-Jun-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: malloc: skip adding too small pools
Malloc skips adding pools that are too small to initialize with.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Tested-by: Jens Wiklander <jens.wikl
libutils: malloc: skip adding too small pools
Malloc skips adding pools that are too small to initialize with.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 51932e38 | 26-May-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils/newlib: clean sub.mk
As most newlib source files needs more or less the same flags to compile, apply the flags with cflags-y and clags-remove-y instead of individual flags for each file.
R
libutils/newlib: clean sub.mk
As most newlib source files needs more or less the same flags to compile, apply the flags with cflags-y and clags-remove-y instead of individual flags for each file.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| f46a4a4a | 25-May-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: add strchr()
Imports strchr() from newlib.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> |
| 385e3901 | 16-May-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: add BIT and SHIFT macros
* Adds BIT32(nr) and BIT64(nr) macros to set a bit in a 32-bit or 64-bit unsigned integer. * Adds SHIFT_U32(v, shift) and SHIFT_U64(v, shift) macros to shift a v
libutils: add BIT and SHIFT macros
* Adds BIT32(nr) and BIT64(nr) macros to set a bit in a 32-bit or 64-bit unsigned integer. * Adds SHIFT_U32(v, shift) and SHIFT_U64(v, shift) macros to shift a value resulting in a 32-bit or 64-bit unsigned integer.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 2ecdb4d7 | 25-Apr-2016 |
Joakim Bech <joakim.bech@linaro.org> |
newlib: Add -ffreestanding to newlib files
When doing builds with –O3, the GCC compiler in some cases generates re-entrant code for memset() function which can result in calling itself infinitely ca
newlib: Add -ffreestanding to newlib files
When doing builds with –O3, the GCC compiler in some cases generates re-entrant code for memset() function which can result in calling itself infinitely causing overflow of stack & data corruption. One way to prevent this from happening is to enable the -ffreestanding compiler flag.
Signed-off-by: Joakim Bech <joakim.bech@linaro.org> Tested-by: Joakim Bech <joakim.bech@linaro.org> (QEMU) Suggested-by: Alexei Fedorov <alexei.fedorov@arm.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Pascal Brand <pascal.brand@linaro.org>
show more ...
|
| a31f13fb | 27-Mar-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: add abs()
Imports abs() from newlib.
Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.fo
libutils: add abs()
Imports abs() from newlib.
Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey) Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU, FVP Aarch64) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 0c81fcd6 | 27-Mar-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutil: add setjmp/longjmp
Imports setjmp/longjmp from newlib.
Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens W
libutil: add setjmp/longjmp
Imports setjmp/longjmp from newlib.
Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| c113066f | 27-Mar-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: move abort declaration to stdlib.h
Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wikla
libutils: move abort declaration to stdlib.h
Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 39a6336d | 17-Mar-2016 |
Jason Lin <Jason.Lin@microsoft.com> |
Fix potential memory corruptions in elf_load.c when loading TAs
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Suggested-by: Jaso
Fix potential memory corruptions in elf_load.c when loading TAs
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Suggested-by: Jason Lin <Jason.Lin@microsoft.com> Suggested-by: Paul Swan <Paul.Swan@microsoft.com> Signed-off-by: Pascal Brand <pascal.brand@st.com>
show more ...
|
| 0de9a5fb | 11-Dec-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
arm: add TA hard-float support
Adds support for hard-float in TAs. Hard-float is enabled by default for all platforms which are capable, currently all. Soft-float is still available if needed.
Revi
arm: add TA hard-float support
Adds support for hard-float in TAs. Hard-float is enabled by default for all platforms which are capable, currently all. Soft-float is still available if needed.
Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey) Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU, FVP) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| a0fdab65 | 05-Jan-2016 |
Jens Wiklander <jens.wiklander@linaro.org> |
Assembly files should use FUNC* macros
* All assembly files should use the FUNC* macros for interwork to work properly. * Moves asm.S into libutils to make it available for TA libs
Reviewed-by: J
Assembly files should use FUNC* macros
* All assembly files should use the FUNC* macros for interwork to work properly. * Moves asm.S into libutils to make it available for TA libs
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey 32/64 bits) Reviewed-by: Pascal Brand <pascal.brand@linaro.org> Tested-by: Jens Wiklander <jens.wiklander@linaro.org> (QEMU) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 69cc0761 | 18-Dec-2015 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils malloc: fix alignment for arm64
Alignment of returned buffer was prior to this patch set to 8 for all platforms. This isn't enough for arm64 where some buffers need to be 16 byte aligned i
libutils malloc: fix alignment for arm64
Alignment of returned buffer was prior to this patch set to 8 for all platforms. This isn't enough for arm64 where some buffers need to be 16 byte aligned instead.
This patch sets required alignment for returned buffers to 8 for ILP32 platforms and 16 for LP64 platforms.
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 ...
|