| 545861aa | 19-Jun-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: remove struct load_seg
Removes struct load_seg, the mobj stored in struct load_seg is already stored in struct vm_region. A flag VM_FLAG_EXCLUSIVE_MOBJ is added to indicate that the mobj in st
core: remove struct load_seg
Removes struct load_seg, the mobj stored in struct load_seg is already stored in struct vm_region. A flag VM_FLAG_EXCLUSIVE_MOBJ is added to indicate that the mobj in struct vm_region should be freed instead of just ignored when removing a region.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| d301003e | 19-Jun-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add VM_FLAG_READONLY
Adds VM_FLAG_READONLY which is used to enforce that read-only parts of a TA binary shared between TAs cannot be mapped read/write.
Reviewed-by: Jerome Forissier <jerome.f
core: add VM_FLAG_READONLY
Adds VM_FLAG_READONLY which is used to enforce that read-only parts of a TA binary shared between TAs cannot be mapped read/write.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| ef55da15 | 19-Jun-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add vm_get_flags()
Adds vm_get_flags() which returns the flags of a mapped region.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@li
core: add vm_get_flags()
Adds vm_get_flags() which returns the flags of a mapped region.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 2e8a1d08 | 18-Jun-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add vm_remap()
Adds vm_remap() to allow changing virtual address of an already established mapping
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <j
core: add vm_remap()
Adds vm_remap() to allow changing virtual address of an already established mapping
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 60ef5192 | 19-Jun-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: split TEE_MATTR_* defines
Splits the TEE_MATTR_* defines into two groups, TEE_MATTR_* and VM_FLAG_*. TEE_MATTR_* is restored to only handle mappings attributes and permissions. The new group V
core: split TEE_MATTR_* defines
Splits the TEE_MATTR_* defines into two groups, TEE_MATTR_* and VM_FLAG_*. TEE_MATTR_* is restored to only handle mappings attributes and permissions. The new group VM_FLAG_* is added to tag regions with purpose and such.
As a consequence user_ta_map(), vm_map_pad() and vm_map() takes one more argument, the flags field.
struct vm_region also gains a flags field, but since only the lower bits are used in the flags and attr fields they are each stored as uint16_t instead.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 642a0c68 | 19-Jun-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: remove unused TEE_MATTR_LOCKED
Removes the now unused TEE_MATTR_LOCKED macro.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.
core: remove unused TEE_MATTR_LOCKED
Removes the now unused TEE_MATTR_LOCKED macro.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 570f0d71 | 19-Jun-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: remove obsolete TEE_MMU_UMAP_* defines
Removes the now obsolete TEE_MMU_UMAP_* defines.
Fixes: 211417d3a487 ("core: more flexible ta mapping") Reviewed-by: Jerome Forissier <jerome.forissier@
core: remove obsolete TEE_MMU_UMAP_* defines
Removes the now obsolete TEE_MMU_UMAP_* defines.
Fixes: 211417d3a487 ("core: more flexible ta mapping") Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| ec295ea0 | 22-Mar-2019 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: change the pattern used to generate asm-defines.h
This commit prepares support for the Clang compiler.
$O/core/include/generated/asm-defines.h is generated from core/arch/arm/kernel/asm-defin
core: change the pattern used to generate asm-defines.h
This commit prepares support for the Clang compiler.
$O/core/include/generated/asm-defines.h is generated from core/arch/arm/kernel/asm-defines.c by the C compiler with the -S flag (generate assembler code), followed by some light post-processing with sed.
The intermediate file ($O/core/include/generated/.asm-defines.s) is actually not a valid assembler file. It contains illegal tokens, which where chosen to make it easy to parse with sed. For example:
==>SM_CTX_SIZE #256 sizeof(struct sm_ctx) @
...is turned into:
#define SM_CTX_SIZE 256 /* sizeof(struct sm_ctx) */
While this works fine with GCC, the Clang compiler won't accept to output invalid assembler. This commit slightly modifies the inline assembler so that the needed information is contained within a .ascii directive:
.ascii "==>SM_CTX_SIZE 248 sizeof(struct sm_ctx)" @
The 'c' constraint (%c0) is added to avoid the # prefix before an immediate value, which is not accepted by Clang either.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| d2c717b2 | 02-Jul-2019 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: console: fix use after free when CFG_DT=y
Commit 770b2afacf33 ("core: more flexible console init from DT") has split configure_console_from_dt() in two parts, the first one being moved to a ne
core: console: fix use after free when CFG_DT=y
Commit 770b2afacf33 ("core: more flexible console init from DT") has split configure_console_from_dt() in two parts, the first one being moved to a new function: get_console_node_from_dt(). Unfortunately, this function may return pointers to a freed buffer.
Fix the problem by allocating each output string on the heap and letting the caller clean on return.
Fixes: 770b2afacf33 ("core: more flexible console init from DT") Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Rouven Czerwinski <r.czerwinksi@pengutronix.de> Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 153479ac | 18-Jun-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: dump ftrace data with ldelf
Uses ldelf to dump ftrace data from a TA.
Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerom
core: dump ftrace data with ldelf
Uses ldelf to dump ftrace data from a TA.
Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey960) Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| d1911a85 | 23-May-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: load TAs using ldelf
Uses ldelf to load and relocate TAs instead of parsing and loading the ELFs in TEE Core. TA abort dumps, ASLR and ftrace are temporarily removed or disabled to be re-enabl
core: load TAs using ldelf
Uses ldelf to load and relocate TAs instead of parsing and loading the ELFs in TEE Core. TA abort dumps, ASLR and ftrace are temporarily removed or disabled to be re-enabled in following commits.
Loading dynamically linked TAs are from now on always supported and cannot be disabled via configuration flags. CFG_TA_DYNLINK is also removed as a configuration option.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 64e49789 | 23-May-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add define TEE_MATTR_LDELF
Adds the define TEE_MATTR_LDELF for temporary mappings needed to load the ldelf binary.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens
core: add define TEE_MATTR_LDELF
Adds the define TEE_MATTR_LDELF for temporary mappings needed to load the ldelf binary.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 8e64b181 | 23-May-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: remove tee_ta_dump_current()
tee_ta_dump_current() is only called from abort_print_current_ta(), move the trivial implementation into abort_print_current_ta() and remove tee_ta_dump_current().
core: remove tee_ta_dump_current()
tee_ta_dump_current() is only called from abort_print_current_ta(), move the trivial implementation into abort_print_current_ta() and remove tee_ta_dump_current().
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 02fbb41a | 27-Jun-2019 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: lockdep: support non-blocking acquire
Adds support for non-blocking lock semantics such as mutex_trylock(). A new function is introduced to instrument this operation: lockdep_tryacquire(). It
core: lockdep: support non-blocking acquire
Adds support for non-blocking lock semantics such as mutex_trylock(). A new function is introduced to instrument this operation: lockdep_tryacquire(). It should be called when it is known that ownership of the underlying object has been granted to the caller. It behaves similarly to lockdep_acquire() in that it does record the call stack and records that the lock is owned. But it does not create any dependencies to the locks that are currently owned by the caller. See "Dynamic Lock Dependency Analysis of Concurrent Systems" [1] section 5.3.
Link: [1] http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.87.132&rep=rep1&type=pdf Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 2c6f8f19 | 23-May-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add TEE_MATTR_SHAREABLE
Adds TEE_MATTR_SHAREABLE to tag mappings that may be shared by other TAs.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <je
core: add TEE_MATTR_SHAREABLE
Adds TEE_MATTR_SHAREABLE to tag mappings that may be shared by other TAs.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| e990d7a6 | 23-May-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add vm_map_pad()
Adds vm_map_pad() which allows specifying how much free memory should be available before and after the map.
This allows mapping the first part of for instance an ELF file wh
core: add vm_map_pad()
Adds vm_map_pad() which allows specifying how much free memory should be available before and after the map.
This allows mapping the first part of for instance an ELF file while knowing that the next part which has to be of a certain offset from the first part also will succeed.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 79b56cf5 | 23-May-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add vm_unmap()
Adds vm_unmap() to simplify removing mappings previously added with vm_map().
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wi
core: add vm_unmap()
Adds vm_unmap() to simplify removing mappings previously added with vm_map().
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| bae0f170 | 23-May-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: file: refactor interface to be thread safe
Adds file_lock() and file_unlock() to change the lock state of a file.
file_new() is removed, the only way to create a file is with file_get_by_tag(
core: file: refactor interface to be thread safe
Adds file_lock() and file_unlock() to change the lock state of a file.
file_new() is removed, the only way to create a file is with file_get_by_tag() which will return an empty newly allocated file if none can be found.
file_add_slice() is added to add slices to a file, one by one.
With this can multiple threads try to load a TA at once, the first one taking the lock will add all the slices to the file.
The code in user_ta.c and elf_load.c using the <file.h> interface can be optimized to allow more operations in parallel.
Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| ccbc05e1 | 03-Jun-2019 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: lockdep: support lock destroy
With lockdep enabled (CFG_LOCKDEP=y), additional cleanup is needed when a mutex is destroyed. This patch adds mutex_destroy_check() which is called when a mutex i
core: lockdep: support lock destroy
With lockdep enabled (CFG_LOCKDEP=y), additional cleanup is needed when a mutex is destroyed. This patch adds mutex_destroy_check() which is called when a mutex is destroyed with mutex_destroy(). From mutex_destroy_check() the corresponding lockdep node and all edges referring to it are removed.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 6b71c85c | 29-May-2019 |
Joakim Bech <joakim.bech@linaro.org> |
HUK: Add enum for TA unique key derivation
Add an additional enum that will be used when deriving device and TA unique keys.
Signed-off-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jens Wi
HUK: Add enum for TA unique key derivation
Add an additional enum that will be used when deriving device and TA unique keys.
Signed-off-by: Joakim Bech <joakim.bech@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| bdeb310a | 10-Jun-2019 |
Sumit Garg <sumit.garg@linaro.org> |
core: enable ftrace for TAs built using shared libraries
To enable ftrace for TAs built with shared libraries, we need to dump the TA state (include regions dump along with mapping to <uuid>.elf) in
core: enable ftrace for TAs built using shared libraries
To enable ftrace for TAs built with shared libraries, we need to dump the TA state (include regions dump along with mapping to <uuid>.elf) in corresponding ftrace buffer for symbolize.py script to map symbols to particular shared libraries.
Signed-off-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey960)
show more ...
|
| d35a00c7 | 16-May-2019 |
Sumit Garg <sumit.garg@linaro.org> |
core: prepare support for TA function tracing
To support TA function tracing OP-TEE core role being: - To initialize and register ftrace buffer per TA session. - To dump TA ftrace buffer to normal w
core: prepare support for TA function tracing
To support TA function tracing OP-TEE core role being: - To initialize and register ftrace buffer per TA session. - To dump TA ftrace buffer to normal world via RPC call in case TA session closes or in case of TA abort.
Signed-off-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (HiKey960)
show more ...
|
| 2a7088cc | 27-May-2019 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: correct _fdt_get_status() description
Correct _fdt_get_status() function description since it returns a positive or null value on success and -1 on error.
Signed-off-by: Etienne Carriere <eti
core: correct _fdt_get_status() description
Correct _fdt_get_status() function description since it returns a positive or null value on success and -1 on error.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Joakim Bech <joakim.bech@linaro.org>
show more ...
|
| 286c31d4 | 29-Apr-2019 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: move embedded DTB out of init sections
This change makes generic boot to discover non-secure memory and console configuration from the external DTB only, no more from the embedded DTB as prior
core: move embedded DTB out of init sections
This change makes generic boot to discover non-secure memory and console configuration from the external DTB only, no more from the embedded DTB as prior this change. When generic boot attempts to access embedded DTB, the embedded DTB gets located in init read-only data section become unnecessary too big. With this change, embedded DTB now lies in the standard pageable read-only data section, relaxing memory footprint constraint.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| eb5d5313 | 27-May-2019 |
Etienne Carriere <etienne.carriere@st.com> |
drivers/stpmic1: unpaged low power sequence
STPMIC1 is used by the secure world to driver the system low power sequences. Since these sequences are executed in unpaged context, the driver gets the c
drivers/stpmic1: unpaged low power sequence
STPMIC1 is used by the secure world to driver the system low power sequences. Since these sequences are executed in unpaged context, the driver gets the configuration from the DTB during the initialization and provides optimized functions to load target configuration at runtime.
This change makes STPMIC1 driver to call the memory footprint optimized function stm32_i2c_read_write_membyte() for I2C transfer instead of generic stm32_i2c_mem_read()/stm32_i2c_mem_write(). This is more suitable to OP-TEE pager constraints on the platform.
This changes removes now unused STPMIC1_I2C_TIMEOUT_US.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|