| 19c8abe1 | 23-Oct-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: pta/gprof.c: get rid of init_memparam()
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens
core: pta/gprof.c: get rid of init_memparam()
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 ...
|
| 05aaaa3b | 19-Oct-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: pta_socket.c: simplify struct thread_param
Simplify struct thread_param usage in PTA socket with direct initialization.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jero
core: pta_socket.c: simplify struct thread_param
Simplify struct thread_param usage in PTA socket with direct initialization.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 13eb4e3c | 19-Oct-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: use struct thread_param for RPC
Use struct thread_param as an abstraction of the parameters used for RPC.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <
core: use struct thread_param for RPC
Use struct thread_param as an abstraction of the parameters used for RPC.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 7445d9ac | 13-Nov-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
Move __early_ta from <compiler.h> to <kernel/early_ta.h>
The __early_ta macro is used only in C files generated by scripts/ta_bin_to_c.py. There is no reason to have it defined in a widely used head
Move __early_ta from <compiler.h> to <kernel/early_ta.h>
The __early_ta macro is used only in C files generated by scripts/ta_bin_to_c.py. There is no reason to have it defined in a widely used header like <compiler.h>.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 1de462e1 | 04-Oct-2018 |
Sumit Garg <sumit.garg@linaro.org> |
drivers: GICv3: Handle group 1 secure interrupts
As per GICv3 architecture specification (Section 4.6 Interrupt grouping), secure EL1 (Trusted OS) handles secure group 1 physical interrupts and EL3
drivers: GICv3: Handle group 1 secure interrupts
As per GICv3 architecture specification (Section 4.6 Interrupt grouping), secure EL1 (Trusted OS) handles secure group 1 physical interrupts and EL3 handles group 0 physical interrupts which are considered as FIQs (foreign interrupt) for Trusted OS.
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (FVP) Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
show more ...
|
| 74a41cfa | 27-Sep-2018 |
Sumit Garg <sumit.garg@linaro.org> |
synquacer: Set default number of threads to 8
Synquacer is 24 core system but 24 threads seems to be overkill in terms of memory usage. So kept it to 8 threads for now.
Acked-by: Jerome Forissier <
synquacer: Set default number of threads to 8
Synquacer is 24 core system but 24 threads seems to be overkill in terms of memory usage. So kept it to 8 threads for now.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
show more ...
|
| eb32eb0b | 05-Nov-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
tee_time_arm_cntpct.c: remove mpa.h dependency
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> |
| 97d78f5b | 26-Oct-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: move initialization of common mobjs
Moves initialization of mobj_sec_ddr and mobj_tee_ram to mobj.c.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <je
core: move initialization of common mobjs
Moves initialization of mobj_sec_ddr and mobj_tee_ram to mobj.c.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 8aff6c03 | 08-Nov-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: remove thread_{add,rem}_mutex()
With the recently merged lockdep patches thread_add_mutex() and thread_rem_mutex() are obsolete. Remove them to save memory and overhead.
Acked-by: Jerome Fori
core: remove thread_{add,rem}_mutex()
With the recently merged lockdep patches thread_add_mutex() and thread_rem_mutex() are obsolete. Remove them to save memory and overhead.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 968facb1 | 06-Nov-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: fix compile error with CFG_CORE_WORKAROUND_SPECTRE_BP_SEC=n
Fixes compile error: CC ../out-os-qemu/core/arch/arm/mm/tee_mm.o core/arch/arm/kernel/thread.c:984:16: error: ‘select_vector’
core: fix compile error with CFG_CORE_WORKAROUND_SPECTRE_BP_SEC=n
Fixes compile error: CC ../out-os-qemu/core/arch/arm/mm/tee_mm.o core/arch/arm/kernel/thread.c:984:16: error: ‘select_vector’ defined but not used [-Werror=unused-function] static vaddr_t select_vector(vaddr_t a) ^~~~~~~~~~~~~ cc1: all warnings being treated as errors
when compiled with CFG_CORE_WORKAROUND_SPECTRE_BP_SEC=n
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 2683339f | 06-Nov-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
unwind: remove useless #if defined(CFG_UNWIND)
unwind_arm32.c and unwind_arm64.c are only compiled when CFG_UNWIND=y so there is no need to check that flag again.
Signed-off-by: Jerome Forissier <j
unwind: remove useless #if defined(CFG_UNWIND)
unwind_arm32.c and unwind_arm64.c are only compiled when CFG_UNWIND=y so there is no need to check that flag again.
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> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| ab0df69e | 15-Oct-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: instrument mutexes with lockdep
Implements lockdep hooks for mutexes. CFG_LOCKDEP is disabled by default, because it causes a noticeable slowdown (plain xtest runs 2-4x slower).
Tested-by: Je
core: instrument mutexes with lockdep
Implements lockdep hooks for mutexes. CFG_LOCKDEP is disabled by default, because it causes a noticeable slowdown (plain xtest runs 2-4x slower).
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (QEMU, HiKey960) 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> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 447633de | 16-Oct-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
unwind: remove debug messages
The debug messages "vsp out of bounds" (arm32) or "FP out of bounds" (arm64) are shown quite often when call stacks are captured (observed when running the lockdep algo
unwind: remove debug messages
The debug messages "vsp out of bounds" (arm32) or "FP out of bounds" (arm64) are shown quite often when call stacks are captured (observed when running the lockdep algorithm on mutexes for instance). The call stacks look fine nonetheless. So, remove these traces.
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> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b3fd78c4 | 14-Sep-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: introduce lockdep algorithm
This commit introduces an algorithm that may be used to detect improper usage of locks at runtime. It can detect two kinds errors:
1. A thread tries to release a
core: introduce lockdep algorithm
This commit introduces an algorithm that may be used to detect improper usage of locks at runtime. It can detect two kinds errors:
1. A thread tries to release a lock it does not own, 2. A thread tries to aquire a lock and the operation could *potentially* result in a deadlock.
The potential deadlock detection assumes that the code adheres to a strict locking hierarchy, in other word, that there is a partial ordering on the locks so that there can be no situation where circular waits can occur. To put things simply, any two locks should be acquired in the same order in the same thread. This addresses the following case:
[Thread #1] [Thread #2]
lock(A) lock(B) lock(B) lock(A) <-- deadlock! ...
The algorithm builds the lock hierarchy dynamically and reports as soon as a violation is detected.
The interface is made of two functions: lockdep_lock_acquire() and lockdep_lock_release(), which are meant to be introduced in the implementation of the actual lock objects. The "acquire" hook tells the algorithm that a particular lock is about to be requested by a particular thread, while the "release" hook is meant to be called before the lock is actually released. If an error is detected, debugging information is sent to the console, and panic() is called. The debugging information includes the lock cycle that was detected (in the above example, {A, B}), as well as the call stacks at the points where the locks were acquired.
The good thing with such an instrumentation of the locking code is that there is no need to wait for an actual deadlock to occur in order to detect potential problems. For instance, the timing of execution in the above example could be different but the problem would still be detected:
[Thread #1] [Thread #2]
lock(A) lock(B) unlock(B) unlock(A) lock(B) lock(A) <-- error!
A pseudo-TA is added for testing (pta/core_lockdep_tests.c).
This code is based on two sources: - A presentation called "Dl-Check: dynamic potential deadlock detection tool for Java programs" [1], although the somewhat complex MNR algorithm for topological ordering of a DAG was not used; - A depth-first search algorithm [2] was used instead.
Link: [1] https://www.slideshare.net/IosifItkin/tmpa2017-dlcheck-dynamic-potential-deadlock-detection-tool-for-java-programs Link: [2] https://en.wikipedia.org/wiki/Topological_sorting#Depth-first_search 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> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| a367dcbb | 20-Sep-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: add unw_get_kernel_stack()
Adds a function to obtain the current kernel call stack as an array. This is useful for debugging code which may need to record the call stack at various point of th
core: add unw_get_kernel_stack()
Adds a function to obtain the current kernel call stack as an array. This is useful for debugging code which may need to record the call stack at various point of the kernel execution.
Depends on CFG_UNWIND=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> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 968f5aa7 | 12-Sep-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: pta: group self tests together
Avoid repeating $(CFG_TEE_CORE_EMBED_INTERNAL_TESTS) for each core self-test source file by using a ifeq block. In addition to making things shorter, it is now e
core: pta: group self tests together
Avoid repeating $(CFG_TEE_CORE_EMBED_INTERNAL_TESTS) for each core self-test source file by using a ifeq block. In addition to making things shorter, it is now easier to introduce conditional tests which would otherwise need one ifeq per feature to be tested: we can simply use src-$(CFG_FOO) += core_foo_tests.c.
No functional change.
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> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 7edfb8f5 | 24-Oct-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: mobj.c: sort #includes
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> |
| 6dbb931a | 05-May-2018 |
Christopher Co <christopher.co@microsoft.com> |
plat-imx: Add i.MX6SoloX Udoo Neo Full platform flavor
Add support for i.MX6SoloX Udoo Neo Full. https://shop.udoo.org/usa/neo/udoo-neo-full.html
Signed-off-by: Christopher Co <christopher.co@micro
plat-imx: Add i.MX6SoloX Udoo Neo Full platform flavor
Add support for i.MX6SoloX Udoo Neo Full. https://shop.udoo.org/usa/neo/udoo-neo-full.html
Signed-off-by: Christopher Co <christopher.co@microsoft.com> Signed-off-by: Jordan Rhee <jordanrh@microsoft.com> Tested-by: Jordan Rhee <jordanrh@microsoft.com>
show more ...
|
| 4e10cbd5 | 25-Sep-2018 |
Jordan Rhee <jordanrh@microsoft.com> |
plat-imx: add mx7dclsom platform flavor
Tested-by: Jordan Rhee <jordanrh@microsoft.com> Signed-off-by: Jordan Rhee <jordanrh@microsoft.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> |
| 40784ed0 | 26-Sep-2018 |
Jordan Rhee <jordanrh@microsoft.com> |
plat-imx: fix compile error for mx6qhmbedge flavor
Set DDR sze and console UART base in conf.mk to avoid a compilation error.
Tested-by: Jordan Rhee <jordanrh@microsoft.com> Signed-off-by: Jordan R
plat-imx: fix compile error for mx6qhmbedge flavor
Set DDR sze and console UART base in conf.mk to avoid a compilation error.
Tested-by: Jordan Rhee <jordanrh@microsoft.com> Signed-off-by: Jordan Rhee <jordanrh@microsoft.com> Acked-by: Peng Fan <peng.fan@nxp.com>
show more ...
|
| 078b214a | 18-Oct-2018 |
Jerome Forissier <jerome.forissier@linaro.org> |
qemu: increase CFG_DTB_MAX_SIZE to 1 MiB
Since upstream QEMU commit 14ec3cbd7c1e ("device_tree: Increase FDT_MAX_SIZE to 1 MiB"), which is included in release v2.12.1 and later, OP-TEE initializatio
qemu: increase CFG_DTB_MAX_SIZE to 1 MiB
Since upstream QEMU commit 14ec3cbd7c1e ("device_tree: Increase FDT_MAX_SIZE to 1 MiB"), which is included in release v2.12.1 and later, OP-TEE initialization fails with the following error (-3 is -FDT_ERR_NOSPACE):
E/TC:0 0 init_fdt:808 Invalid Device Tree at 0x40000000: error -3
Increase CFG_DTB_MAX_SIZE accordingly. Tested with the current tip of the QEMU master branch, in 32- and 64-bit modes (note that our 64-bit QEMU setup needs a TF-A patch -- PLAT_QEMU_DT_MAX_SIZE needs to be set to 1 MiB too).
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| cd278f78 | 19-Oct-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: simplify shm cookie handling
Simplifies SHM cookie handling by storing the cookie in the mobj instead of putting the burden on the caller. The cookie parameter is dropped from the thread_rpc_*
core: simplify shm cookie handling
Simplifies SHM cookie handling by storing the cookie in the mobj instead of putting the burden on the caller. The cookie parameter is dropped from the thread_rpc_*_payload() functions. All callers of those functions are also updated and unused cookie members of related structs are removed too.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 82e1d963 | 24-Sep-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: thread: thread_rpc_{free,alloc}_arg() static
Makes thread_rpc_alloc_arg() and thread_rpc_free_arg() static since they are only used internally in thread.c
Reviewed-by: Jerome Forissier <jerom
core: thread: thread_rpc_{free,alloc}_arg() static
Makes thread_rpc_alloc_arg() and thread_rpc_free_arg() static since they are only used internally in thread.c
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| cc459a42 | 19-Oct-2018 |
Victor Chong <victor.chong@linaro.org> |
hikey960: change DRAM1_SIZE_NSEC for 4GB board
SoC reference manual [1] page 2-23 says that the DRAM address range is 0x00000000 - 0xDFFFFFFF for a total of 3.5GB, so the limit would seem to be 0xE0
hikey960: change DRAM1_SIZE_NSEC for 4GB board
SoC reference manual [1] page 2-23 says that the DRAM address range is 0x00000000 - 0xDFFFFFFF for a total of 3.5GB, so the limit would seem to be 0xE0000000, not 0x100000000, or 0xFFE00000 based on [2] and [3].
Link: [1] https://github.com/96boards/documentation/raw/master/consumer/hikey/hikey960/hardware-docs/HiKey960_SoC_Reference_Manual.pdf Link: [2] https://github.com/OP-TEE/optee_os/issues/2597#issuecomment-428587050 Link: [3] https://github.com/OP-TEE/optee_os/issues/2597#issuecomment-428865951 Fixes: https://github.com/OP-TEE/optee_os/issues/2597 Signed-off-by: Victor Chong <victor.chong@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| daaf4f11 | 12-Oct-2018 |
Daniel McIlvaney <damcilva@microsoft.com> |
core: modify tee_otp_get_hw_unique_key to return TEE_Result
Getting the hardware key can fail on some platforms. Modify the function signature to return an appropriate error code.
Signed-off-by: Da
core: modify tee_otp_get_hw_unique_key to return TEE_Result
Getting the hardware key can fail on some platforms. Modify the function signature to return an appropriate error code.
Signed-off-by: Daniel McIlvaney <damcilva@microsoft.com> Signed-off-by: Jordan Rhee <jordanrh@microsoft.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|