| 01980f3f | 16-May-2023 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: interrupt: rename itr_init()
Renames itr_init() to interrupt_main_init() as a later change will modify interrupt chip API functions using interrupt_ as prefix.
Reviewed-by: Jens Wiklander <je
core: interrupt: rename itr_init()
Renames itr_init() to interrupt_main_init() as a later change will modify interrupt chip API functions using interrupt_ as prefix.
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 358bf47c | 16-May-2023 |
Etienne Carriere <etienne.carriere@linaro.org> |
core: interrupt: rename itr_core_handler()
Renames itr_core_handler() to interrupt_main_handler() as a later change will modify interrupt chip API functions using interrupt_ as prefix.
Reviewed-by:
core: interrupt: rename itr_core_handler()
Renames itr_core_handler() to interrupt_main_handler() as a later change will modify interrupt chip API functions using interrupt_ as prefix.
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| b5aff6de | 02-Mar-2023 |
Clément Léger <clement.leger@bootlin.com> |
core: dt_driver: add support for DT_DRIVER_PINCTRL
In order to handle pinctrl the same way that other driver are handled by DT driver support, modify node parsing to refer to the parent node in case
core: dt_driver: add support for DT_DRIVER_PINCTRL
In order to handle pinctrl the same way that other driver are handled by DT driver support, modify node parsing to refer to the parent node in case we are handling a pinctrl request.
Signed-off-by: Clément Léger <clement.leger@bootlin.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
show more ...
|
| 6e2fe64a | 21-Feb-2023 |
Clément Léger <clement.leger@bootlin.com> |
dt_driver_test: add tests for gpio controller framework
Add various tests for the GPIO dt controller framework much like what was done for the rstclr system.
Signed-off-by: Clément Léger <clement.l
dt_driver_test: add tests for gpio controller framework
Add various tests for the GPIO dt controller framework much like what was done for the rstclr system.
Signed-off-by: Clément Léger <clement.leger@bootlin.com> Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 4fc179b6 | 11-May-2023 |
Thomas Perrot <thomas.perrot@bootlin.com> |
drivers: gpio: add device-tree based gpio controller framework
Build a small gpio framework based on the device-tree infrastructure and on top of the existing gpio.h content. This framework allows t
drivers: gpio: add device-tree based gpio controller framework
Build a small gpio framework based on the device-tree infrastructure and on top of the existing gpio.h content. This framework allows to register gpio controllers and to retrieve gpio struct based on a "<name>-gpios" properties.
Signed-off-by: Clément Léger <clement.leger@bootlin.com> Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 4e45454a | 11-Apr-2023 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add dt_getprop_as_number()
Adds dt_getprop_as_number() to read a property and parse it as a number returned as a uint64_t. The size of the property determines if it's read as an unsigned 32-bi
core: add dt_getprop_as_number()
Adds dt_getprop_as_number() to read a property and parse it as a number returned as a uint64_t. The size of the property determines if it's read as an unsigned 32-bit or 64-bit integer.
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 946f37ee | 04-Apr-2022 |
Etienne Carriere <etienne.carriere@linaro.org> |
driver: tpm2: remove TPM2 driver
Remove TPM2 driver from OP-TEE core. OP-TEE will instead rely on a remote REE TPM2 driver allowing REE OS to embed TPM2 software stack and leverage TPM2 features.
A
driver: tpm2: remove TPM2 driver
Remove TPM2 driver from OP-TEE core. OP-TEE will instead rely on a remote REE TPM2 driver allowing REE OS to embed TPM2 software stack and leverage TPM2 features.
Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
show more ...
|
| 8577287c | 17-Apr-2023 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: ftrace: mark thread_get_tsd() and thread_get_id() as __noprof
When CFG_FTRACE_SUPPORT=y CFG_SYSCALL_FTRACE=y, the following call stack happens (QEMUv8):
_mcount() ftrace_enter() get_fbu
core: ftrace: mark thread_get_tsd() and thread_get_id() as __noprof
When CFG_FTRACE_SUPPORT=y CFG_SYSCALL_FTRACE=y, the following call stack happens (QEMUv8):
_mcount() ftrace_enter() get_fbuf() thread_get_tsd() thread_get_id()
Therefore thread_get_tsd() and thread_get_id() must be tagged with __noprof, otherwise a recursive call to _mcount() is triggered leading to infinite recursion, stack overflow and a lockup of the TEE core.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
show more ...
|
| a7a0664e | 14-Apr-2023 |
Jerome Forissier <jerome.forissier@linaro.org> |
core: mark thread_init_core_local_stacks() as __nostackcheck
As its name implies, thread_init_core_local_stacks() performs stack initializations therefore it should not invoke the stack-checking hoo
core: mark thread_init_core_local_stacks() as __nostackcheck
As its name implies, thread_init_core_local_stacks() performs stack initializations therefore it should not invoke the stack-checking hooks which are enabled when CFG_CORE_DEBUG_CHECK_STACKS=y. This is done by adding the __nostackcheck qualifier to the function. Without it, the boot hangs early and nothing is printed on the secure console.
Note that this also fixes similar symptoms with syscall profiling (CFG_FTRACE_SUPPORT=y CFG_SYSCALL_FTRACE=y) because the _mcount()/ __gnu_mcount_nc() hooks need the stack. Both __nostackcheck and __noprof expand to __attribute__((no_instrument_function)).
Fixes: ca8258906949 ("core: split core/arch/arm/kernel/thread.c") Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
show more ...
|
| 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 ...
|