| a471cdec | 16-Feb-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: reset cancellation mask on TA exit
Before this patch, the TA cancellation mask was only reset when the session was created, but the GP spec requires the cancellation mask to be reset each time
core: reset cancellation mask on TA exit
Before this patch, the TA cancellation mask was only reset when the session was created, but the GP spec requires the cancellation mask to be reset each time a TA is entered via one of its entry points. So fix this by resetting the cancellation mask each time a TA returns.
Link: https://github.com/OP-TEE/optee_test/issues/731 Fixes: b01047730e77 ("Open-source the TEE Core") Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 344ef8a4 | 21-Mar-2024 |
Alvin Chang <alvinga@andestech.com> |
core: kernel: Fix typo in __do_panic()
Must be "preemption" instead of "prehemption".
Signed-off-by: Alvin Chang <alvinga@andestech.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> |
| 3a20c661 | 12-Mar-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
core: kernel: mutex compliant with PM sequences
Add mutex_pm_aware_*() functions for mutex used on resources accessed at runtime using a conventional mutex and also during low power sequences that e
core: kernel: mutex compliant with PM sequences
Add mutex_pm_aware_*() functions for mutex used on resources accessed at runtime using a conventional mutex and also during low power sequences that execute in a non-thread context.
This change defines MUTEX_PM_AWARE_INITIALIZER macro from a new header file (mutex_pm_aware.h) instead of existing mutex.h to prevent a circular dependency between spinlock.h (requires thread.h), thread.h (indirectly includes mutex.h) and mutex.h (that would depend on spinlock.h for definition of the SPINLOCK_UNLOCK macro ).
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 1cf7e98d | 14-Mar-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: replace REGISTER_TIME_SOURCE()
Remove REGISTER_TIME_SOURCE() and implement tee_time_get_sys_time() and tee_time_get_sys_time_protection_level() directly in the file where REGISTER_TIME_SOURCE(
core: replace REGISTER_TIME_SOURCE()
Remove REGISTER_TIME_SOURCE() and implement tee_time_get_sys_time() and tee_time_get_sys_time_protection_level() directly in the file where REGISTER_TIME_SOURCE() was used previously.
By avoiding indirect calls the linker can optimize the dependency tree properly and we can remove the DECLARE_KEEP_PAGER() directive needed for arm_cntpct_time_source.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 82631bd4 | 13-Mar-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add CFG_CALLOUT
Add CFG_CALLOUT with a default value assigned from CFG_CORE_ASYNC_NOTIF to control if the callout service should be enabled.
Signed-off-by: Jens Wiklander <jens.wiklander@lina
core: add CFG_CALLOUT
Add CFG_CALLOUT with a default value assigned from CFG_CORE_ASYNC_NOTIF to control if the callout service should be enabled.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| fc59f3d8 | 13-Mar-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: notif: assert callback is unpaged
Add an assert that the atomic_cb() pointer in notif_register_driver() points to an unpaged address since the callback function will be called from an interrup
core: notif: assert callback is unpaged
Add an assert that the atomic_cb() pointer in notif_register_driver() points to an unpaged address since the callback function will be called from an interrupt handler and must not be paged.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| c5b5aca0 | 13-Mar-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: callout: assert callback is unpaged
Add an assert that the callback parameter passed to callout_add() points to an unpaged address since the callback function will be called from an interrupt
core: callout: assert callback is unpaged
Add an assert that the callback parameter passed to callout_add() points to an unpaged address since the callback function will be called from an interrupt handler and must not be paged.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 47bcc886 | 07-Mar-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: notif_send_async(): remove debug print
Remove the debug print D/TC:0 notif_send_async:93 0x0 from notif_send_async().
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by:
core: notif_send_async(): remove debug print
Remove the debug print D/TC:0 notif_send_async:93 0x0 from notif_send_async().
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| cf707bd0 | 31-Jan-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add callout service
Add a callout service to call registered callback functions at a given time from now. A callout is periodic or oneshot depending on how the callback function returns. Callb
core: add callout service
Add a callout service to call registered callback functions at a given time from now. A callout is periodic or oneshot depending on how the callback function returns. Callback functions execute in nexus and interrupt context.
The callout service is initialized with callout_service_init() and depends on an abstract timer interface to manage the hardware timer. callout_service_cb() needs to be called from the timer interrupt handler to drive the callout service.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| ccd64a52 | 02-Mar-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
core: kernel: add timeout_elapsed_us()
Add API function timeout_elapsed_us() to measure to time since or until an initialized timeout reference elapses.
This function relies on other timeout_*() AP
core: kernel: add timeout_elapsed_us()
Add API function timeout_elapsed_us() to measure to time since or until an initialized timeout reference elapses.
This function relies on other timeout_*() API functions are therefore depends on CFG_CORE_HAS_GENERIC_TIMER being enabled.
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 458ef442 | 21-Feb-2024 |
Alvin Chang <alvinga@andestech.com> |
drivers: Implement semihosting based console driver for log
Implement a simple console driver which uses semihosting operations to read/write the trace messages. There are two paths to output the tr
drivers: Implement semihosting based console driver for log
Implement a simple console driver which uses semihosting operations to read/write the trace messages. There are two paths to output the trace messages: - If the caller of semihosting_console_init() provides the path of the file, the driver will try to open that file, and output the log to that host side file. - If the caller of semihosting_console_init() does not provide the path of the file, the driver will connect the console to the host debug console directly.
If CFG_SEMIHOSTING_CONSOLE is enabled, OP-TEE will try to initialize the semihosting console driver by given CFG_SEMIHOSTING_CONSOLE_FILE.
Signed-off-by: Alvin Chang <alvinga@andestech.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 55ab8f06 | 27-Feb-2024 |
Alvin Chang <alvinga@andestech.com> |
core: Refactor console_init() and introduce plat_console_init()
Since there are some cross-platform console drivers, we let console_init() be common code to have a chance to initialize those console
core: Refactor console_init() and introduce plat_console_init()
Since there are some cross-platform console drivers, we let console_init() be common code to have a chance to initialize those console drivers (e.g., semihosting console).
If the cross-platform console drivers are not configured to be compiled, plat_console_init() will be invoked to initialize platform-specific console driver.
Signed-off-by: Alvin Chang <alvinga@andestech.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 7e2a1038 | 21-Feb-2024 |
Alvin Chang <alvinga@andestech.com> |
core: kernel: Add semihosting functions
Semihosting is a mechanism that enables target to communicate and use I/O facilities on a host computer which is running a debugger, such as GDB. The I/O faci
core: kernel: Add semihosting functions
Semihosting is a mechanism that enables target to communicate and use I/O facilities on a host computer which is running a debugger, such as GDB. The I/O facilities include character {read|write} {from|to} the semihosting host side console or a file. In other words, OP-TEE OS can output log to the host side console or the host side file, if there is a semihosting host and OP-TEE OS requests the semihosting operations to that host.
If CFG_SEMIHOSTING is enabled, some semihosting functions will be compiled into OP-TEE kernel, including: - semihosting_sys_readc() - semihosting_sys_writec() - semihosting_open() - semihosting_read() - semihosting_write() - semihosting_close()
Note that the architectures which support semihosting should provide their implementation of __do_semihosting(), which performs semihosting instruction to raise the semihosting request.
Signed-off-by: Alvin Chang <alvinga@andestech.com> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 49d0c90d | 12-Feb-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: call init_multi_core_panic_handler() earlier
Call init_multi_core_panic_handler() slightly earlier in during boot using nex_driver_init_late() instead of boot_final(). This avoids with a comin
core: call init_multi_core_panic_handler() earlier
Call init_multi_core_panic_handler() slightly earlier in during boot using nex_driver_init_late() instead of boot_final(). This avoids with a coming assert() in the GIC driver to check that SGI and PPI can't be configured after or at nex_release_init_resource().
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 4199b52f | 12-Feb-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: notif_register_driver() assert ndrv is nexus memory
Notification drivers defined by struct notif_driver are processed from the nexus when non-secure virtualization is enabled. Add an assert in
core: notif_register_driver() assert ndrv is nexus memory
Notification drivers defined by struct notif_driver are processed from the nexus when non-secure virtualization is enabled. Add an assert in notif_register_driver() to check that the passed driver struct is located in nexus memory.
Move all notif global state variables into nexus memory. The mutex used for yielding notifications is the exception since notif_deliver_event() is called from a partition outside of the nexus.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 7037ff8a | 12-Feb-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: move _time_source into __nex_bss
To make tee_time_get_sys_time() work reliably with CFG_NS_VIRTUALIZATION=y move _time_source into nexus memory.
Signed-off-by: Jens Wiklander <jens.wiklander@
core: move _time_source into __nex_bss
To make tee_time_get_sys_time() work reliably with CFG_NS_VIRTUALIZATION=y move _time_source into nexus memory.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 3d52f27c | 12-Feb-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: move multi_core_panic_handler into __nex_data
Multi core panic interrupts are delivered on all cores on panic. For this to work reliably with CFG_NS_VIRTUALIZATION=y make sure that multi_core_
core: move multi_core_panic_handler into __nex_data
Multi core panic interrupts are delivered on all cores on panic. For this to work reliably with CFG_NS_VIRTUALIZATION=y make sure that multi_core_panic_handler is located in nexus memory.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| a039ffc6 | 05-Jan-2024 |
Clement Faure <clement.faure@nxp.com> |
core: kernel: dt: check return values from snprintf()
Check return values from snprintf() function.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Jerome Forissier <jerome.foriss
core: kernel: dt: check return values from snprintf()
Check return values from snprintf() function.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| e33c3ff5 | 05-Jan-2024 |
Clement Faure <clement.faure@nxp.com> |
core: kernel: check device tree property pointer
Assert `prop` pointer before using it in fdt32_to_cpu().
Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Jerome Forissier <jerome.
core: kernel: check device tree property pointer
Assert `prop` pointer before using it in fdt32_to_cpu().
Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 5ca2c365 | 10-Jan-2024 |
Clement Faure <clement.faure@nxp.com> |
core: remove unnecessary includes
Remove unnecessary includes.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander
core: remove unnecessary includes
Remove unnecessary includes.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 4fd40c39 | 22-Mar-2023 |
Clément Léger <clement.leger@bootlin.com> |
core: dt_driver: add DT_DRIVER_NVMEM support
Handle DT_DRIVER_NVMEM the same way that DT_DRIVER_PINCTRL is handled. Indeed, it uses the same kind of DT references (phandle to a subnode of a controll
core: dt_driver: add DT_DRIVER_NVMEM support
Handle DT_DRIVER_NVMEM the same way that DT_DRIVER_PINCTRL is handled. Indeed, it uses the same kind of DT references (phandle to a subnode of a controller) to get a nvmem cell.
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@foss.st.com>
show more ...
|
| 963eb457 | 10-Jan-2024 |
Clement Faure <clement.faure@nxp.com> |
core: fix unintended sign extension
Suspicious implicit sign extension: memtag_get_tag(kaddr) with type uint8_t (8 bits, unsigned) is promoted in memtag_get_tag(kaddr) << uref_tag_shift to type int
core: fix unintended sign extension
Suspicious implicit sign extension: memtag_get_tag(kaddr) with type uint8_t (8 bits, unsigned) is promoted in memtag_get_tag(kaddr) << uref_tag_shift to type int (32 bits, signed), then sign-extended to type unsigned long (64 bits, unsigned).
If memtag_get_tag(kaddr) << uref_tag_shift is greater than 0x7FFFFFFF, the upper bits of the result will all be 1.
Cast memtag_get_tag(kaddr) to vaddr_t to avoid implicit sign extension.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| a5bf88f0 | 17-Jun-2022 |
Gatien Chevallier <gatien.chevallier@foss.st.com> |
core: fix trace in add_node_to_probe()
Fix trace format, drv_name and node_name are inverted.
Fixes: b3a88b52a17c ("core: dt_driver probe sequence") Signed-off-by: Gatien Chevallier <gatien.chevall
core: fix trace in add_node_to_probe()
Fix trace format, drv_name and node_name are inverted.
Fixes: b3a88b52a17c ("core: dt_driver probe sequence") Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 508e2476 | 29-Nov-2023 |
Raymond Mao <raymond.mao@linaro.org> |
core: update transfer list header and signature
Add tl->flags and TL_FLAGS_HAS_CHECKSUM to align to the latest FW Handoff spec update. Bypass checksum verifying and updating if TL_FLAGS_HAS_CHECKSUM
core: update transfer list header and signature
Add tl->flags and TL_FLAGS_HAS_CHECKSUM to align to the latest FW Handoff spec update. Bypass checksum verifying and updating if TL_FLAGS_HAS_CHECKSUM bit is not set in tl->flags. Update TL signature to 4a0f_b10b to align to the latest FW Handoff spec update.
Note: It causes Transfer List ABI breakage due to FW Handoff spec stays with same rev number (v0.9) with above changes.
Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 86dbb179 | 27-Nov-2023 |
Raymond Mao <raymond.mao@linaro.org> |
core: remove unused bytes from transfer list
Only marks the minimum bytes required by alignment as 'TL_TAG_EMPTY' and release the rest of unused bytes from transfer list when downsizing the data of
core: remove unused bytes from transfer list
Only marks the minimum bytes required by alignment as 'TL_TAG_EMPTY' and release the rest of unused bytes from transfer list when downsizing the data of a transfer entry. Function transfer_list_set_data_size() will remove the unused bytes from the transfer list so that the freed space is allocable when adding new transfer entries.
Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|