| 239420cb | 13-Apr-2023 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: ftrace: mark thread_get_id_may_fail() as __noprof
With CFG_FTRACE_SUPPORT=y CFG_ULIBS_MCOUNT=y CFG_SYSCALL_FTRACE=y (tested on QEMUv8), OP-TEE boot hangs due to infinite recursion:
ftrace_ent
core: ftrace: mark thread_get_id_may_fail() as __noprof
With CFG_FTRACE_SUPPORT=y CFG_ULIBS_MCOUNT=y CFG_SYSCALL_FTRACE=y (tested on QEMUv8), OP-TEE boot hangs due to infinite recursion:
ftrace_enter() get_fbuf() thread_get_id_may_fail() _mcount() [or __gnu_mcount_nc()] ftrace_enter() ...
Break the cycle by tagging thread_get_id_may_fail() with __noprof so that it doesn't call _mcount()/__gnu_mcount_nc().
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
show more ...
|
| c11218eb | 28-Apr-2023 |
Clement Faure <clement.faure@nxp.com> |
pta: stats: fix compilation incompatible pointer warning
To reproduce the issue: $ make PLATFORM=imx-mx8mmevk CFG_WITH_STATS=y CFG_TA_STATS=y
core/pta/stats.c: In function ‘get_user_ta_stats’: core
pta: stats: fix compilation incompatible pointer warning
To reproduce the issue: $ make PLATFORM=imx-mx8mmevk CFG_WITH_STATS=y CFG_TA_STATS=y
core/pta/stats.c: In function ‘get_user_ta_stats’: core/pta/stats.c:169:37: warning: passing argument 2 of ‘tee_ta_instance_stats’ from incompatible pointer type [-Wincompatible-pointer-types] 169 | &p[0].memref.size); | ^~~~~~~~~~~~~~~~~ | | | size_t * {aka long unsigned int *} In file included from core/include/kernel/pseudo_ta.h:10, from core/pta/stats.c:8: core/include/kernel/tee_ta_manager.h:171:56: note: expected ‘uint32_t *’ {aka ‘unsigned int *’} but argument is of type ‘size_t *’ {aka ‘long unsigned int *’} 171 | TEE_Result tee_ta_instance_stats(void *buff, uint32_t *buff_size); | ~~~~~~~~~~^~~~~~~~~ core/pta/stats.c: At top level: cc1: note: unrecognized command-line option ‘-Wno-c2x-extensions’ may have been intended to silence earlier diagnostics
Fixes: 7509620b8b95 ("GP131: Update TEE_Param") Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 426790bd | 13-Feb-2023 |
Jeffrey Kardatzke <jkardatzke@google.com> |
drivers: add cbmem console driver
This adds a CBMEM console driver which gets the cbmem address from a device tree with the coreboot table information.
Signed-off-by: Jeffrey Kardatzke <jkardatzke@
drivers: add cbmem console driver
This adds a CBMEM console driver which gets the cbmem address from a device tree with the coreboot table information.
Signed-off-by: Jeffrey Kardatzke <jkardatzke@google.com> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 9e3c57c8 | 28-Feb-2023 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: dt_driver: move related content from dt.h to dt_driver.h
Moves so-called dt_driver related declarations and definitions from dt.h to dt_drivers.h. Incidentally adds an inline description to en
core: dt_driver: move related content from dt.h to dt_driver.h
Moves so-called dt_driver related declarations and definitions from dt.h to dt_drivers.h. Incidentally adds an inline description to enum dt_driver_type. This change clarifies when a source file shall include dt.h and/or dt_driver.h.
This change updates driver source files to include none, one or both of these header files where applicable.
Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 73e27bfa | 07-Apr-2023 |
Gatien Chevallier <gatien.chevallier@foss.st.com> |
core: dt: fix return value in fdt_read_uint32_array()
If fdt_getprop() returns 0, the error code is contained in the fourth parameter: len in this case.
Return len instead of -FDT_ERR_NOTFOUND.
Si
core: dt: fix return value in fdt_read_uint32_array()
If fdt_getprop() returns 0, the error code is contained in the fourth parameter: len in this case.
Return len instead of -FDT_ERR_NOTFOUND.
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 07ced948 | 22-Mar-2023 |
Gatien Chevallier <gatien.chevallier@foss.st.com> |
core: dt: add kernel DT API to retrieve regs by name
This patch adds _fdt_get_reg_props_by_index() and _fdt_get_reg_props_by_name() APIs.
Signed-off-by: Christophe Kerello <christophe.kerello@foss.
core: dt: add kernel DT API to retrieve regs by name
This patch adds _fdt_get_reg_props_by_index() and _fdt_get_reg_props_by_name() APIs.
Signed-off-by: Christophe Kerello <christophe.kerello@foss.st.com> Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| a2e8c036 | 22-Mar-2023 |
Gatien Chevallier <gatien.chevallier@foss.st.com> |
core: dt: add fdt_read_size() helper
This patch adds fdt_read_size() helper.
Signed-off-by: Christophe Kerello <christophe.kerello@foss.st.com> Signed-off-by: Gatien Chevallier <gatien.chevallier@f
core: dt: add fdt_read_size() helper
This patch adds fdt_read_size() helper.
Signed-off-by: Christophe Kerello <christophe.kerello@foss.st.com> Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 7c3a6b7b | 22-Mar-2023 |
Gatien Chevallier <gatien.chevallier@foss.st.com> |
core: dt: add kernel DT API fdt_read_uint32_index()
This patch adds fdt_read_uint32_index() API. This API reads one cell from a given multi-value property.
This patch updates fdt_read_uint32() and
core: dt: add kernel DT API fdt_read_uint32_index()
This patch adds fdt_read_uint32_index() API. This API reads one cell from a given multi-value property.
This patch updates fdt_read_uint32() and fdt_read_uint32_default() to use fdt_read_uint32_index() API
Signed-off-by: Christophe Kerello <christophe.kerello@foss.st.com> Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| f354a5d8 | 05-Apr-2023 |
Gatien Chevallier <gatien.chevallier@foss.st.com> |
core: replace _fdt_ prefix with fdt_ for device tree API
As per upstream discussion, there is no reason to keep _fdt_ prefix. Replaces it with fdt_ for all occurrences.
Signed-off-by: Gatien Cheval
core: replace _fdt_ prefix with fdt_ for device tree API
As per upstream discussion, there is no reason to keep _fdt_ prefix. Replaces it with fdt_ for all occurrences.
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| e7a2db34 | 14-Mar-2023 |
Clément Léger <clement.leger@bootlin.com> |
core: dt_driver: add support for DT_DRIVER_I2C
Integrating I2C support within the dt_driver mechanism require to change the way controller are retrieved. Indeed, when using i2c, the children are loc
core: dt_driver: add support for DT_DRIVER_I2C
Integrating I2C support within the dt_driver mechanism require to change the way controller are retrieved. Indeed, when using i2c, the children are located under a parent I2C controller node. This implies to use another method to parse node heriarchy and ignore the case when the provider has no phandle.
Signed-off-by: Clément Léger <clement.leger@bootlin.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| bbbb5d00 | 27-Mar-2023 |
Clément Léger <clement.leger@bootlin.com> |
core: dt_driver: remove early return if no phandle is found for provider
This case now happens for various subsystems which do not uses direct phandles to the controller but rather phandles to child
core: dt_driver: remove early return if no phandle is found for provider
This case now happens for various subsystems which do not uses direct phandles to the controller but rather phandles to child of the controller. For such description, the controller itself might not have any "phandle" property since there is no reference to it.
Signed-off-by: Clément Léger <clement.leger@bootlin.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 33cc94df | 13-Mar-2023 |
Clément Léger <clement.leger@bootlin.com> |
core: dt_driver: add phandle node and fdt to dt_driver_phandle_args
With pinctrl, it is necessary for the provider to access the node which will need to be apply since it contains custom controller
core: dt_driver: add phandle node and fdt to dt_driver_phandle_args
With pinctrl, it is necessary for the provider to access the node which will need to be apply since it contains custom controller properties that need to be parsed. In order to integrate pinctrl with the existing dt_driver generic support, add these members and fill them when invoking the get_of_device() callback.
Signed-off-by: Clément Léger <clement.leger@bootlin.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| b031393c | 11-Apr-2023 |
Weizhao Jiang <weizhaoj@amazon.com> |
core: tee_ta_instance_stats(): correct the allocation size of dump_ctx
Problem: Wrongly use sizeof(struct tee_ta_dump_stats) to calculate out the allocation size of dump_ctx. This error causes buffe
core: tee_ta_instance_stats(): correct the allocation size of dump_ctx
Problem: Wrongly use sizeof(struct tee_ta_dump_stats) to calculate out the allocation size of dump_ctx. This error causes buffer overflow when iterating dump_ctx.
Solution: Correct the allocation size to sizeof(struct tee_ta_dump_ctx) * ta_count.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Tested-by: Weizhao Jiang <weizhaoj@amazon.com> Signed-off-by: Weizhao Jiang <weizhaoj@amazon.com>
show more ...
|
| 9eabc2b4 | 03-Apr-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: fix loading of encrypted TA
The total size of headers for TAs signed with a subkey varies, take that into account when sanity checking the img_size field of the signed header.
Fixes: 19b1ce2b
core: fix loading of encrypted TA
The total size of headers for TAs signed with a subkey varies, take that into account when sanity checking the img_size field of the signed header.
Fixes: 19b1ce2b2b2b ("core: ree_fs: check ta size before use") Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (vexpress-qemu_armv8a)
show more ...
|
| 9901df47 | 29-Mar-2023 |
Weizhao Jiang <weizhaoj@amazon.com> |
core: dump_ta_memstats(): check TA initialization completion before accessing it
Problem: In some concurrent cases, TA dump will try to dump a TA which has not completed TA initialization and the TA
core: dump_ta_memstats(): check TA initialization completion before accessing it
Problem: In some concurrent cases, TA dump will try to dump a TA which has not completed TA initialization and the TA stack pointer isn't set. That causes a data abort when accessing its stack.
Solution: Check the user TA initialization is completed or not. If it is still being initialized, return TEE_ERROR_BAD_STATE. https://github.com/OP-TEE/optee_os/issues/5905
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Weizhao Jiang <weizhaoj@amazon.com> Signed-off-by: Weizhao Jiang <weizhaoj@amazon.com>
show more ...
|
| fa40bed5 | 10-Mar-2023 |
Weizhao Jiang <weizhaoj@amazon.com> |
core: fix out-of-bounds access of dump_ctx
Problem: in the case of no UTA running, the buffer of dump_ctx will be allocated with 0 size and passed to init_dump_ctx(). That causes buffer overrunning.
core: fix out-of-bounds access of dump_ctx
Problem: in the case of no UTA running, the buffer of dump_ctx will be allocated with 0 size and passed to init_dump_ctx(). That causes buffer overrunning.
Solution: Check buffer size before allocate the buffer. If it's 0, return TEE_ERROR_ITEM_NOT_FOUND.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Weizhao Jiang <weizhaoj@amazon.com> Signed-off-by: Weizhao Jiang <weizhaoj@amazon.com>
show more ...
|
| 97db86ce | 03-Feb-2023 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: tpm: fix syntax in trace message
Fixes build warning (trace message below) when CFG_CORE_TPM_EVENT_LOG=y.
core/kernel/tpm.c:115:8: warning: format ‘%lu’ expects argument of type ‘long unsigne
core: tpm: fix syntax in trace message
Fixes build warning (trace message below) when CFG_CORE_TPM_EVENT_LOG=y.
core/kernel/tpm.c:115:8: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=] 115 | EMSG("TPM: Not enough space for the log: %zu, %lu", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 116 | buf_size, tpm_log_size); | ~~~~~~~~~~~~ | | | size_t {aka unsigned int}
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| b76b2296 | 03-Feb-2023 |
Jerome Forissier <jerome.forissier@linaro.org> |
virt: rename CFG_VIRTUALIZATION to CFG_NS_VIRTUALIZATION
With the advent of virtualization support at S-EL2 in the Armv8.4-A architecture, CFG_VIRTUALIZATION has become ambiguous. Let's rename it to
virt: rename CFG_VIRTUALIZATION to CFG_NS_VIRTUALIZATION
With the advent of virtualization support at S-EL2 in the Armv8.4-A architecture, CFG_VIRTUALIZATION has become ambiguous. Let's rename it to CFG_NS_VIRTUALIZATION to indicate more clearly that it is about supporting virtualization on the non-secure side.
This commit is the result of the following command:
$ for f in $(git grep -l -w CFG_VIRTUALIZATION); do \ sed -i -e 's/CFG_VIRTUALIZATION/CFG_NS_VIRTUALIZATION/g' $f; \ done
...plus the compatibility line in mk/config.mk:
CFG_NS_VIRTUALIZATION ?= $(CFG_VIRTUALIZATION)
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@linaro.org> Acked-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
show more ...
|
| af78e1b1 | 24-Oct-2022 |
Imre Kis <imre.kis@arm.com> |
ldelf: Provide access to TS load address
Propagate ELF load address from ldelf to user mode context as a preparation for load address relative memory regions.
Signed-off-by: Imre Kis <imre.kis@arm.
ldelf: Provide access to TS load address
Propagate ELF load address from ldelf to user mode context as a preparation for load address relative memory regions.
Signed-off-by: Imre Kis <imre.kis@arm.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 74f6dd9b | 01-Feb-2023 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core, ldelf: add support for RISC-V
RISC-V support of argument for ldelf dump state.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Jerome Forissier <jerome.forissier@lin
core, ldelf: add support for RISC-V
RISC-V support of argument for ldelf dump state.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| cb5f271c | 01-Feb-2023 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core, ldelf: replace is_arm32 with is_32bit
To refer to 32-bit mode, this commit replace is_arm32 with is_32bit in the following files: - core/kernel/ldelf_loader.c - ldelf/include/ldelf.h - ldelf/m
core, ldelf: replace is_arm32 with is_32bit
To refer to 32-bit mode, this commit replace is_arm32 with is_32bit in the following files: - core/kernel/ldelf_loader.c - ldelf/include/ldelf.h - ldelf/main.c
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| d8e4ae07 | 01-Feb-2023 |
Marouene Boubakri <marouene.boubakri@nxp.com> |
core: kernel: move ldelf_loader.c to core/kernel
Make other architecture implementations benefit from ldelf_loader.c, therefore move it from core/arch/arm/kernel to core/kernel. The header file is a
core: kernel: move ldelf_loader.c to core/kernel
Make other architecture implementations benefit from ldelf_loader.c, therefore move it from core/arch/arm/kernel to core/kernel. The header file is already located outside the arch folder.
Signed-off-by: Marouene Boubakri <marouene.boubakri@nxp.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| fc82e622 | 19-Dec-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: finalize scall layer
Finalizes the new scall layer by renaming remaining files so the generic scall layer resides in core/include/kernel/scall.h and core/kernel/scall.c.
New architectures are
core: finalize scall layer
Finalizes the new scall layer by renaming remaining files so the generic scall layer resides in core/include/kernel/scall.h and core/kernel/scall.c.
New architectures are expected to provide a core/arch/arm/include/kernel/arch_scall.h with functions needed to deal with the architecture specific struct thread_scall_regs usage in core/kernel/scall.c.
New architectures are also expected to provide an implementation of scall_save_panic_stack() called from scall_sys_return_helper().
Reviewed-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 ...
|
| ab5363c6 | 19-Dec-2022 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: introduce scall layer from svc parts
Introduces a scall layer by renaming various thread_svc* names and _*handle_svc() functions and function pointers as a first step in doing architecture neu
core: introduce scall layer from svc parts
Introduces a scall layer by renaming various thread_svc* names and _*handle_svc() functions and function pointers as a first step in doing architecture neutral syscall processing.
The name scall is used instead of syscall since the syscall_ prefix is reserved for the functions implementing the actual syscall. While scall is the infrastructure used to reach the syscall functions.
No files are renamed and removed at this stage. This patch doesn't change any behaviour.
Reviewed-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 ...
|
| 94397285 | 27-Jan-2022 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: notif: allow GIC_PPI usage for async notif
Allows to use GIC_PPI interrupts for asynchronous notification.
This change replace macro COMPILE_TIME_ASSERT() with static_assert() as the former i
core: notif: allow GIC_PPI usage for async notif
Allows to use GIC_PPI interrupts for asynchronous notification.
This change replace macro COMPILE_TIME_ASSERT() with static_assert() as the former is deprecated.
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|