| 910441c3 | 20-May-2024 |
Yu Chien Peter Lin <peterlin@andestech.com> |
core: kernel: factor out shared memory boot-time helpers
The static and dynamic shared memory helpers used for boot-time reservation/registration are non-architecture-specific. Moving them into the
core: kernel: factor out shared memory boot-time helpers
The static and dynamic shared memory helpers used for boot-time reservation/registration are non-architecture-specific. Moving them into the generic boot.c file will help avoid duplicated code and improve maintainability.
Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com> Reviewed-by: Alvin Chang <alvinga@andestech.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 17022665 | 31-May-2024 |
Alvin Chang <alvinga@andestech.com> |
core: kernel: Remove unused ta_time_offs in user_ta_ctx
It seems that "ta_time_offs" member is unused now. Thus, remove it from user_ta_ctx structure.
Signed-off-by: Alvin Chang <alvinga@andestech.
core: kernel: Remove unused ta_time_offs in user_ta_ctx
It seems that "ta_time_offs" member is unused now. Thus, remove it from user_ta_ctx structure.
Signed-off-by: Alvin Chang <alvinga@andestech.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 48a1cce4 | 02-May-2024 |
Gatien Chevallier <gatien.chevallier@foss.st.com> |
core: firewall: add firewall framework
Add a generic firewall controller framework. The goal of this framework is to offer access control and configuration APIs, that are implemented in the firewall
core: firewall: add firewall framework
Add a generic firewall controller framework. The goal of this framework is to offer access control and configuration APIs, that are implemented in the firewall controllers drivers, to the firewall consumers. This framework requires an embedded device tree.
A firewall controller is an access controller [1]. It should register itself as a provider to the framework. Firewall controllers have the possibility to populate their bus according to defined firewall accesses defined in the "access-controllers" property in each of the device's node.
Any device that consumes one or more firewall should refer it/them in their "access-controllers" property. Arguments can be passed along with the phandle of the firewall controller(s).
Link: https://patchwork.kernel.org/project/linux-media/patch/20240105130404.301172-2-gatien.chevallier@foss.st.com/ [1] Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 2e6b9fc5 | 06-May-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
core: interrupts: fix inline comment typo on DT property name
Fix DT property named "interrupts-extended", mistakenly named "extended-interrupts" in interrupt API function inline description comment
core: interrupts: fix inline comment typo on DT property name
Fix DT property named "interrupts-extended", mistakenly named "extended-interrupts" in interrupt API function inline description comments.
Fixes: 33a0c8350ac1 ("core: interrupt: registering interrupt providers") Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 7921973c | 05-May-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
core: kernel: use explicit unsigned int type in condvar
Replace unsigned with unsigned int as type of struct condvar::spin_lock.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Revie
core: kernel: use explicit unsigned int type in condvar
Replace unsigned with unsigned int as type of struct condvar::spin_lock.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| ade2f1cb | 12-Mar-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
core: kernel: fix include order in spinlock.h
Fix order of #include directives in spinlock.h.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Jerome Forissier <jerome.fo
core: kernel: fix include order in spinlock.h
Fix order of #include directives in spinlock.h.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| ea413ca5 | 31-Jan-2024 |
Gavin Liu <gavin.liu@mediatek.com> |
core: mutex: add support timeout condvar
Add support timeout condvar based on timeout notify
Signed-off-by: Gavin Liu <gavin.liu@mediatek.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org
core: mutex: add support timeout condvar
Add support timeout condvar based on timeout notify
Signed-off-by: Gavin Liu <gavin.liu@mediatek.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 450f8ada | 23-Jan-2024 |
Gavin Liu <gavin.liu@mediatek.com> |
core: notif: add support timeout notify
Add support timeout notification, allowing to avoid waiting indefinitely for the completion of an event
Signed-off-by: Gavin Liu <gavin.liu@mediatek.com> Rev
core: notif: add support timeout notify
Add support timeout notification, allowing to avoid waiting indefinitely for the completion of an event
Signed-off-by: Gavin Liu <gavin.liu@mediatek.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 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 ...
|
| f6412fbd | 12-Mar-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
core: kernel: thread spin locking
Add thread_spin_lock() and thread_spin_unlock() for active spinning locks in situation where we need an exclusive lock in a thread and interruptible context even at
core: kernel: thread spin locking
Add thread_spin_lock() and thread_spin_unlock() for active spinning locks in situation where we need an exclusive lock in a thread and interruptible context even at the cost of a high CPU usage.
These function are intended to be used in thread context hence they assert being executed in such a context. This is to prevent on mistakenly spin in an atomic context which potentially leads to a deadlock situation.
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 ...
|
| b2f99d20 | 01-Feb-2024 |
Olivier Deprez <olivier.deprez@arm.com> |
core: boot: fix memtag init sequence
Based on following observations on FVP: With boot_init_memtag called before MMU enable, DC GZA hits an alignment fault. This is because all accesses are of devic
core: boot: fix memtag init sequence
Based on following observations on FVP: With boot_init_memtag called before MMU enable, DC GZA hits an alignment fault. This is because all accesses are of device type when MMU is off. Arm ARM states for DC GZA: "If the memory region being modified is any type of Device memory, this instruction can give an alignment fault." Moving boot_init_memtag after MMU enable, DC GZA hits a permission fault, this is because the range returned by core_mmu_get_secure_memory consists of pages mapped RO (text sections) and then RW (data sections) consecutively. DC GZA is a write instruction executed towards an RO page leading to a fault.
To fix this, split boot_init_memtag into two halves: - Setup memtag operations before MMU is enabled such that MAIR_EL1 is properly configured for normal tagged memory. - Clear core TEE RW sections after MMU is enabled.
Closes: https://github.com/OP-TEE/optee_os/issues/6649 Signed-off-by: Olivier Deprez <olivier.deprez@arm.com> [jw rewrote boot_clear_memtag()] Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| c41db53b | 01-Feb-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: define generic callout service initializer
Add a generic timer_init_callout_service() to be implemented in architecture or platform specific code. The function shall provide an implementation
core: define generic callout service initializer
Add a generic timer_init_callout_service() to be implemented in architecture or platform specific code. The function shall provide an implementation of the abstract timer interface needed by the callout service and register a timer interrupt callback to call callout_service_cb().
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 ...
|
| 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 ...
|
| c4cdfb70 | 06-Mar-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add __must_check attribute to cpu_spin_lock_xsave()
cpu_spin_lock_xsave() masks exceptions, takes the spinlock and returns previous exception state to be restored by cpu_spin_unlock_xrestore()
core: add __must_check attribute to cpu_spin_lock_xsave()
cpu_spin_lock_xsave() masks exceptions, takes the spinlock and returns previous exception state to be restored by cpu_spin_unlock_xrestore(). The previously returned exception state must always be supplied so add the __must_check attribute to cpu_spin_lock_xsave() and its debug variants.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
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 ...
|
| fab37ad7 | 02-Mar-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
core: kernel: factorize delay and timeout implementation
Factorize RISC-V and Arm architectures implementation of delay and timeout API functions into generic core kernel source directory.
Architec
core: kernel: factorize delay and timeout implementation
Factorize RISC-V and Arm architectures implementation of delay and timeout API functions into generic core kernel source directory.
Architecture or platform only need to implement timer tick count read function delay_cnt_read() and timer tick frequency (in Hertz) delay_cnt_freq() which is related to CFG_CORE_HAS_GENERIC_TIMER support.
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 6b0ac81d | 12-Jul-2023 |
Etienne Carriere <etienne.carriere@foss.st.com> |
core: kernel: describe udelay()/mdelay()
Add inline description comment for udelay() and mdelay() for consistency of OP-TEE OS source tree, even if the function names are quite explicit and do not s
core: kernel: describe udelay()/mdelay()
Add inline description comment for udelay() and mdelay() for consistency of OP-TEE OS source tree, even if the function names are quite explicit and do not strictly need such descriptions.
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-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 ...
|
| 9a4ec172 | 29-Sep-2023 |
Patrick Delaunay <patrick.delaunay@foss.st.com> |
core: pm: add macro for PM_HINT_STATE access
Add helper macros to read and test the power state hints provided by the platform during power management state transitions.
Reviewed-by: Etienne Carrie
core: pm: add macro for PM_HINT_STATE access
Add helper macros to read and test the power state hints provided by the platform during power management state transitions.
Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com> Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
show more ...
|
| 4078bcde | 12-Feb-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: virt, ffa: keep guest partition until resources are reclaimed
Move a struct guest_partition to prtn_destroy_list if there are resources remaining to be reclaimed by the hypervisor. Currently t
core: virt, ffa: keep guest partition until resources are reclaimed
Move a struct guest_partition to prtn_destroy_list if there are resources remaining to be reclaimed by the hypervisor. Currently this is needed with FF-A and SPMC at S-EL1.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 3e0b361e | 12-Feb-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: ffa: store shm_bits in partition for SPMC at S-EL1
Store the bitmask keeping track of allocated shared memory handles in the current partition when configured with CFG_NS_VIRTUALIZATION and CF
core: ffa: store shm_bits in partition for SPMC at S-EL1
Store the bitmask keeping track of allocated shared memory handles in the current partition when configured with CFG_NS_VIRTUALIZATION and CFG_CORE_SEL1_SPMC.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 97452933 | 24-Jan-2024 |
Niklas Kirschall <niki.nice1203@gmail.com> |
core: kernel: fix typo in huk_subkey.h inline comment
Fix a typo in `huk_subkey.h` inline comment where TEE_SUCCES should be TEE_SUCCESS.
Acked-by: Etienne Carriere <etienne.carriere@foss.st.com> S
core: kernel: fix typo in huk_subkey.h inline comment
Fix a typo in `huk_subkey.h` inline comment where TEE_SUCCES should be TEE_SUCCESS.
Acked-by: Etienne Carriere <etienne.carriere@foss.st.com> Signed-off-by: Niklas Kirschall <niki.nice1203@gmail.com>
show more ...
|
| 5a982d0e | 30-Jan-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: dt: provide stubbed dt_getprop_as_number()
When compiled with CFG_DT=n link the following error can occur: aarch64-linux-gnu-ld.bfd: out/arm/core/arch/arm/kernel/boot.o: in function `get_sec_m
core: dt: provide stubbed dt_getprop_as_number()
When compiled with CFG_DT=n link the following error can occur: aarch64-linux-gnu-ld.bfd: out/arm/core/arch/arm/kernel/boot.o: in function `get_sec_mem_from_manifest': core/arch/arm/kernel/boot.c:1511: undefined reference to `dt_getprop_as_number' aarch64-linux-gnu-ld.bfd: core/arch/arm/kernel/boot.c:1519: undefined reference to `dt_getprop_as_number' aarch64-linux-gnu-ld.bfd: out/arm/core/mm/core_mmu.o: in function `collect_device_mem_ranges': core/mm/core_mmu.c:982: undefined reference to `dt_getprop_as_number' aarch64-linux-gnu-ld.bfd: core/mm/core_mmu.c:993: undefined reference to `dt_getprop_as_number'
Fix this by adding a stubbed version of dt_getprop_as_number() when CFG_DT=n.
Link: https://github.com/OP-TEE/optee_os/issues/6537 Fixes: 4e45454a85d3 ("core: add dt_getprop_as_number()") Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| c37489ba | 08-Jan-2024 |
Clement Faure <clement.faure@nxp.com> |
core: msg_param: remove recursion in included headers
kernel/msg_param.h includes itself.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Etienne Carriere <etienne.carriere@foss.s
core: msg_param: remove recursion in included headers
kernel/msg_param.h includes itself.
Signed-off-by: Clement Faure <clement.faure@nxp.com> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|