| 5e4210e9 | 22-Nov-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add scattered array
Adds a scattered array which allows defining arrays scattered over several source files. The implementation is based on some support by the linker.
This is a generic solut
core: add scattered array
Adds a scattered array which allows defining arrays scattered over several source files. The implementation is based on some support by the linker.
This is a generic solution to initcalls and other similar scattered initializations.
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 ...
|
| c95b9511 | 23-Nov-2018 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: embedded secure device tree
This change introduces configurations CFG_EMDED_DTB and CFG_EMBED_DTB_SOURCE_FILE. When CFG_EMDED_DTB=y a device tree blob (DTB) is embedded in a read-only section
core: embedded secure device tree
This change introduces configurations CFG_EMDED_DTB and CFG_EMBED_DTB_SOURCE_FILE. When CFG_EMDED_DTB=y a device tree blob (DTB) is embedded in a read-only section of the core based on an in-tree device tree source (DTS) file.
CFG_EMBED_DTS_SOURCE_FILE defines the relative path of the target device in core/arch/$(ARCH)/dts.
Non empty CFG_EMBED_DTS_SOURCE_FILE content implies CFG_EMBED_DTB=y. CFG_EMBED_DTB=y mandates CFG_EMBED_DTS_SOURCE_FILE definition. CFG_EMDED_DTB=y mandates CFG_DT=y.
Since the embedded DTB is read-only, core do not attempt to modify it adding information such as OP-TEE resources nodes and properties. Core still get generic information such as system memory address range and debug console configuration from the embedded DTB.
Documentation includes a DT section in the OP-TEE design description.
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 ...
|
| a67a20cb | 23-Nov-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: fix bug in vm_map() causing pager panic()
Prior to this patch vm_map() didn't allocate new page tables (PGTs) as needed, it only checked that it later would be possible to allocate the needed
core: fix bug in vm_map() causing pager panic()
Prior to this patch vm_map() didn't allocate new page tables (PGTs) as needed, it only checked that it later would be possible to allocate the needed PGTs. This is enough if the user_ta_ctx (UTC) isn't active. With dynamically linked libraries the UTC will be active when vm_map() is called to make room for the new segments. If the already allocated PGTs happen to cover even the new memory range it will still work, this is normally the case with CFG_WITH_LPAE=y since each page table covers 2 MiB. With CFG_WITH_LPAE=n the page tables only covers 1 MiB and that's not enough when loading the os_test TA in xtest case 1006.
This patch fixes the problem by instead of just checking that it later will be possible to allocate needed PGTs, it also allocates the PGTs if the UTC is active.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| a01855fd | 20-Nov-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: remove MOBJ_INVALID_COOKIE
Removes MOBJ_INVALID_COOKIE which resulted in an unexpected ABI change against the normal world driver. Instead 0 is continued to be used as an invalid/absent cookie
core: remove MOBJ_INVALID_COOKIE
Removes MOBJ_INVALID_COOKIE which resulted in an unexpected ABI change against the normal world driver. Instead 0 is continued to be used as an invalid/absent cookie value.
Tested-by: Sumit Garg <sumit.garg@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reported-by: Sumit Garg <sumit.garg@linaro.org> Fixes: cd278f78382b ("core: simplify shm cookie handling") Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 6009538c | 24-Oct-2018 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: introduce generic optee_rpc_cmd.h
Replaces the OPTEE_MSG RPC command protocol descriptions in optee_msg.h and optee_msg_supplicant with a generic optee_rpc_cmd.h. Defined names are also refact
core: introduce generic optee_rpc_cmd.h
Replaces the OPTEE_MSG RPC command protocol descriptions in optee_msg.h and optee_msg_supplicant with a generic optee_rpc_cmd.h. Defined names are also refactored to mirror the new structure.
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 ...
|
| 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 ...
|