| a25cf4cf | 10-Nov-2025 |
Alistair Higgins <Alistair_Higgins@trimble.com> |
core: make boot_arg_nsec_entry globally accessible
Required on TI platforms that need access to access the boot arguments in an `early_init()` call. Need the boot args to memory-map and initialise t
core: make boot_arg_nsec_entry globally accessible
Required on TI platforms that need access to access the boot arguments in an `early_init()` call. Need the boot args to memory-map and initialise the HUK before it is used in the `tee_fs_init_key_manager` service init.
Signed-off-by: Alistair Higgins <Alistair_Higgins@trimble.com> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| c9c847d5 | 11-Jun-2025 |
Aleksandr Iashchenko <aleksandr.iashchenko@linutronix.de> |
core: asan: add support for custom panic callback
Add asan_set_panic_cb() to register a custom panic callback.
The ability to set a panic callback will be used in ASan tests to capture and validate
core: asan: add support for custom panic callback
Add asan_set_panic_cb() to register a custom panic callback.
The ability to set a panic callback will be used in ASan tests to capture and validate expected violations without triggering a full system panic, which is important for automated testing.
Introduce asan_report() to provide more detailed reporting of access violations, including nearby shadow memory dump.
Signed-off-by: Aleksandr Iashchenko <aleksandr.iashchenko@linutronix.de> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 990c4711 | 28-Jan-2025 |
Antonio Borneo <antonio.borneo@foss.st.com> |
core: interrupt: add set_wake for power-management wake-on on interrupt
For interrupt controllers that can handle power-management wake-up when receiving an interrupt, add the operation set_wake().
core: interrupt: add set_wake for power-management wake-on on interrupt
For interrupt controllers that can handle power-management wake-up when receiving an interrupt, add the operation set_wake().
Signed-off-by: Antonio Borneo <antonio.borneo@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 6f9a4373 | 03-Jun-2025 |
Antonio Borneo <antonio.borneo@foss.st.com> |
core: kernel: dt_driver: fix copy/paste comment
While adding DT_DRIVER_PINCTRL, an incorrect word was reported by copy/paste from the existing comment for DT_DRIVER_RSTCTRL.
Drop the word 'reset' f
core: kernel: dt_driver: fix copy/paste comment
While adding DT_DRIVER_PINCTRL, an incorrect word was reported by copy/paste from the existing comment for DT_DRIVER_RSTCTRL.
Drop the word 'reset' from the comment for DT_DRIVER_PINCTRL.
Fixes: b5aff6de7052 ("core: dt_driver: add support for DT_DRIVER_PINCTRL") Signed-off-by: Antonio Borneo <antonio.borneo@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| bd8bea6f | 23-May-2025 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: boot_mem: enable asan support
Add boot_mem_init_asan() to tag all allocated memory with asan_tag_access().
Allocations with boot_mem_alloc() and boot_mem_alloc_tmp() are tagged with asan_tag_
core: boot_mem: enable asan support
Add boot_mem_init_asan() to tag all allocated memory with asan_tag_access().
Allocations with boot_mem_alloc() and boot_mem_alloc_tmp() are tagged with asan_tag_access().
boot_mem_foreach_padding() temporarily allow access to paddings for the callback and restores no-access if the callback returns false to tell that the padding wasn't consumed.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| bb538722 | 02-Jun-2025 |
Alvin Chang <alvinga@andestech.com> |
core: replace CFG_DYN_STACK_CONFIG with CFG_DYN_CONFIG
This commit replaces CFG_DYN_STACK_CONFIG with CFG_DYN_CONFIG since now RISC-V also supports CFG_DYN_STACK_CONFIG.
Signed-off-by: Alvin Chang
core: replace CFG_DYN_STACK_CONFIG with CFG_DYN_CONFIG
This commit replaces CFG_DYN_STACK_CONFIG with CFG_DYN_CONFIG since now RISC-V also supports CFG_DYN_STACK_CONFIG.
Signed-off-by: Alvin Chang <alvinga@andestech.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 86df92b3 | 08-May-2025 |
Alvin Chang <alvinga@andestech.com> |
core: kernel: Remove CFG_BOOT_INIT_CURRENT_THREAD_CORE_LOCAL
Now both ARM and RISC-V architectures support initialize thread_core_local[current_core_pos] before calling C code. Thus, we can deprecat
core: kernel: Remove CFG_BOOT_INIT_CURRENT_THREAD_CORE_LOCAL
Now both ARM and RISC-V architectures support initialize thread_core_local[current_core_pos] before calling C code. Thus, we can deprecate CFG_BOOT_INIT_CURRENT_THREAD_CORE_LOCAL and corresponding code.
Signed-off-by: Alvin Chang <alvinga@andestech.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Yu-Chien Peter Lin <peter.lin@sifive.com>
show more ...
|
| aa0620cf | 20-Mar-2025 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: dynamic allocation of threads and their stacks
With CFG_DYN_CONFIG enabled, use dynamic allocation of threads and their stacks.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Revie
core: dynamic allocation of threads and their stacks
With CFG_DYN_CONFIG enabled, use dynamic allocation of threads and their stacks.
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 ...
|
| 91d4649d | 20-Mar-2025 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add thread_count to thread_init_threads()
Add a thread_count parameter to thread_init_threads(). This must currently always be equal to CFG_NUM_THREADS, but may become a dynamic configuration
core: add thread_count to thread_init_threads()
Add a thread_count parameter to thread_init_threads(). This must currently always be equal to CFG_NUM_THREADS, but may become a dynamic configuration parameter with CFG_DYN_CONFIG=y in later patches.
The array threads[] is changed into a pointer to allow dynamic allocation in later patches. The assembly code is updated accordingly to handle a pointer instead of an array.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Alvin Chang <alvinga@andestech.com> Tested-by: Alvin Chang <alvinga@andestech.com> Reviewed-by: Yu-Chien Peter Lin <peter.lin@sifive.com> Tested-by: Yu-Chien Peter Lin <peter.lin@sifive.com> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 59724f22 | 20-Mar-2025 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: dynamic allocation of thread_core_local and its stacks
With CFG_DYN_CONFIG enabled, use dynamic allocation of thread_core_local and the two stacks, tmp_stack and abt_stack, recorded in it.
Si
core: dynamic allocation of thread_core_local and its stacks
With CFG_DYN_CONFIG enabled, use dynamic allocation of thread_core_local and the two stacks, tmp_stack and abt_stack, recorded in it.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| a4c2e0cb | 20-Mar-2025 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add core_count to thread_init_thread_core_local()
Add a core_count parameter to thread_init_thread_core_local() to enable dynamic configuration of the number of supported cores when configured
core: add core_count to thread_init_thread_core_local()
Add a core_count parameter to thread_init_thread_core_local() to enable dynamic configuration of the number of supported cores when configured with CFG_DYN_STACK_CONFIG=y, or it must be equal to CFG_TEE_CORE_NB_CORE. This is needed in later patches where the number of cores is configured dynamically.
The array thread_core_local[] is changed into a pointer to allow dynamic allocation in later patches. The assembly code is updated accordingly to handle a pointer instead of an array.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Alvin Chang <alvinga@andestech.com> Tested-by: Alvin Chang <alvinga@andestech.com> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 414123ae | 03-Apr-2025 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: ffa: reserve physical memory for manifest
With CFG_CORE_SEL2_SPMC=y (Hafnium as SPMC at S-EL2), the FF-A manifest passed to OP-TEE resides in the memory reserved for OP-TEE just before the loa
core: ffa: reserve physical memory for manifest
With CFG_CORE_SEL2_SPMC=y (Hafnium as SPMC at S-EL2), the FF-A manifest passed to OP-TEE resides in the memory reserved for OP-TEE just before the load address. The physical memory pool is initialized with the entire range of secure memory, with holes carved out for already used memory.
Temporarily allocate the physical memory used by the manifest until it's not needed any longer and released by release_manifest_dt().
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 2e27ec6c | 12-Jan-2025 |
Yu-Chien Peter Lin <peter.lin@sifive.com> |
riscv: kernel: support booting non-contiguous non-zero-based hart IDs
Currently, OP-TEE assumes 0 <= hartid < CFG_TEE_CORE_NB_CORE, and must be contiguous, which fails to accommodate different CPU t
riscv: kernel: support booting non-contiguous non-zero-based hart IDs
Currently, OP-TEE assumes 0 <= hartid < CFG_TEE_CORE_NB_CORE, and must be contiguous, which fails to accommodate different CPU topologies. For example, some RISC-V platforms, such as the HiFive Unmatched board, do not run Linux and OP-TEE on hart0, as it is a monitor core without supervisor mode support.
To address this, introduce hart_index, which is used to index per-hart structures, such as thread_core_local and root_pgt. The hart_index will range from 0 to (CFG_TEE_CORE_NB_CORE - 1), and the primary hart will have an index of 0.
Additionally, a new function, boot_primary_init_core_ids(), is added to initialize secondary hart IDs for booting via sbi_hsm_hart_start().
Signed-off-by: Yu-Chien Peter Lin <peter.lin@sifive.com> Reviewed-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Zong Li <zong.li@sifive.com> Reviewed-by: Alvin Chang <alvinga@andestech.com>
show more ...
|
| b0da0d59 | 06-Mar-2025 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: boot: add boot_init_primary_runtime()
Split the early parts of boot_init_primary_final() into boot_init_primary_runtime(). boot_init_primary_runtime() initializes the runtime, part of that is
core: boot: add boot_init_primary_runtime()
Split the early parts of boot_init_primary_final() into boot_init_primary_runtime(). boot_init_primary_runtime() initializes the runtime, part of that is to generate the PAUTH keys. The PAUTH keys are loaded in assembly before boot_init_primary_final() is called.
This fixes an error when SPs are initialized by entering and exiting S-EL0 from boot_init_primary_final() but the PAUTH registers hasn't been initialized with the right values. E/TC:0 0 Core undef-abort at address 0xe106be4 E/TC:0 0 esr 0x72000000 ttbr0 0x200000e27d000 ttbr1 0x00000000 cidr 0x0 E/TC:0 0 cpu #0 cpsr 0x60000144 E/TC:0 0 x0 0000000000000000 x1 0000000000000000 E/TC:0 0 x2 0000000000000000 x3 0000000000000000 E/TC:0 0 x4 000000000e27a060 x5 000000000e27a05c E/TC:0 0 x6 000000000000009f x7 0000000000000083 E/TC:0 0 x8 0000000000000000 x9 0000000000004367 E/TC:0 0 x10 000000000000009f x11 0000000000000000 E/TC:0 0 x12 0000000000000000 x13 0000000040006f80 E/TC:0 0 x14 0000000000000000 x15 0000000000000000 E/TC:0 0 x16 000000000e107460 x17 0000000000000000 E/TC:0 0 x18 0000000000000000 x19 000000000e002000 E/TC:0 0 x20 000000000e300000 x21 0000000040000000 E/TC:0 0 x22 0000000000000000 x23 000000000e272830 E/TC:0 0 x24 000000000e22c250 x25 0000000000000000 E/TC:0 0 x26 0000000000000000 x27 0000000000000000 E/TC:0 0 x28 0000000000000000 x29 000000000e27a020 E/TC:0 0 x30 0a2ed3b10e1314e8 elr 000000000e106be4 E/TC:0 0 sp_el0 000000000e27a010 E/TC:0 0 TEE load address @ 0xe100000 E/TC:0 0 Core undef-abort at address 0xe106be4 .debug_info+27620 E/TC:0 0 Call stack: E/TC:0 0 0x0e106be4 thread_enter_user_mode at core/arch/arm/kernel/thread.c:1049 E/TC:0 0 0x0e110628 sp_open_session at core/arch/arm/kernel/secure_partition.c:635 E/TC:0 0 0x0e112508 sp_init_uuid at core/arch/arm/kernel/secure_partition.c:1583 E/TC:0 0 0x0e1135f8 sp_init_all at core/arch/arm/kernel/secure_partition.c:2018 E/TC:0 0 0x0e137950 do_init_calls at core/kernel/initcall.c:20 E/TC:0 0 0x0e137b0c call_finalcalls at core/kernel/initcall.c:73
Fixes: b5ec8152f3e5 ("core: arm: refactor boot") 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 ...
|
| bea90f04 | 03-Mar-2025 |
Alvin Chang <alvinga@andestech.com> |
core: Implicitly enable CFG_BOOT_MEM
Now both ARM and RISC-V architectures support and enable CFG_BOOT_MEM by default. It's unnecessary to define CFG_BOOT_MEM. This commit removes CFG_BOOT_MEM and r
core: Implicitly enable CFG_BOOT_MEM
Now both ARM and RISC-V architectures support and enable CFG_BOOT_MEM by default. It's unnecessary to define CFG_BOOT_MEM. This commit removes CFG_BOOT_MEM and relevant dead code.
Signed-off-by: Alvin Chang <alvinga@andestech.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Yu-Chien Peter Lin <peter.lin@sifive.com>
show more ...
|
| 325d4963 | 11-Oct-2023 |
Gatien Chevallier <gatien.chevallier@foss.st.com> |
core: add platform-specific abort handler
Platforms may have specific code to handle an abort when fault type is FAULT_TYPE_IGNORE. Add plat_abort_handler() that can be overridden at platform level
core: add platform-specific abort handler
Platforms may have specific code to handle an abort when fault type is FAULT_TYPE_IGNORE. Add plat_abort_handler() that can be overridden at platform level.
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| ae7f9049 | 07-Feb-2025 |
Etienne Carriere <etienne.carriere@foss.st.com> |
core: interrupt: fix interrupt_set_{affinity|wake}() description
Fix inline description of itr_num argument for interrupt_set_affinity() and interrupt_set_wake().
Fixes: b2d6db21ec5e ("core: interr
core: interrupt: fix interrupt_set_{affinity|wake}() description
Fix inline description of itr_num argument for interrupt_set_affinity() and interrupt_set_wake().
Fixes: b2d6db21ec5e ("core: interrupt: helper function for raise_pi, raise_sgi, set_affinity") Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| d2c318b6 | 07-Feb-2025 |
Etienne Carriere <etienne.carriere@foss.st.com> |
core: interrupt: clarify when dt_get_irq handler is needed
Add an inline comment telling struct itr_chip:dt_get_irq handler is needed only when interrupt consumer manually get configuration informat
core: interrupt: clarify when dt_get_irq handler is needed
Add an inline comment telling struct itr_chip:dt_get_irq handler is needed only when interrupt consumer manually get configuration information from the DT to later configure the interrupt. The aim of this change is to clarify this handler is not needed for interrupt provider registered with interrupt_register_provider() and which consumer rely on interrupt_dt_get_by_*() to configure their interrupts.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| df7874b5 | 14-Feb-2025 |
Etienne Carriere <etienne.carriere@foss.st.com> |
core: interrupt: itr_chip may not require configure handler
The configure handler in struct itr_ops is not required for interrupt providers which consumers only use the DT to get and configure their
core: interrupt: itr_chip may not require configure handler
The configure handler in struct itr_ops is not required for interrupt providers which consumers only use the DT to get and configure their interrupts (with interrupt_dt_get_by_*() and interrupt_create_handler()). Therefore change itr_chip_is_valid() to not enforce its support but add back that constraint for the interrupt main controller.
Add an itr_chip_dt_only_init() helper function for interrupt controllers which consumers only use the DT to configure their interrupt, that is such controllers do not need a configure handler.
itr_chip_is_valid() is not called outside interrupt.c where it is used in itr_chip_init() and itr_chip_dt_only_init() so make it a local function.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 2a50ce7d | 07-Feb-2025 |
Etienne Carriere <etienne.carriere@foss.st.com> |
core: interrupt: rename .add handler to .configure
Rename field add of struct itr_ops to configure for consistency since that handler is used the configure the interrupt. Update existing interrupt d
core: interrupt: rename .add handler to .configure
Rename field add of struct itr_ops to configure for consistency since that handler is used the configure the interrupt. Update existing interrupt drivers accordingly.
By the way fix inline comment spelling typo (s/contrainsts/constraints/).
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| b5ec8152 | 22-Jan-2025 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: arm: refactor boot
Introduce CFG_BOOT_INIT_THREAD_CORE_LOCAL0 to indicate that thread_core_local[0] is initialized before the boot_init_* functions are called.
thread_init_core_local_stacks()
core: arm: refactor boot
Introduce CFG_BOOT_INIT_THREAD_CORE_LOCAL0 to indicate that thread_core_local[0] is initialized before the boot_init_* functions are called.
thread_init_core_local_stacks() and thread_init_thread_core_local() are replaced by a new version of thread_init_thread_core_local() for CFG_BOOT_INIT_THREAD_CORE_LOCAL0=y.
Move initialization of thread_core_local[] from very early to boot_init_primary_late() where various DTBs containing run-time configuration are available. This will be needed in later patches when the number of configured cores can be read from DT or some other run-time configuration.
Move the "OP-TEE version" print and following code from boot_init_primary_late() to boot_init_primary_final()
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 50cbe7eb | 23-Jan-2025 |
Etienne Carriere <etienne.carriere@foss.st.com> |
core: interrupt: explicit dt_get_irq handler expects big endian data
Explicit that struct itr_chip::dt_get_irq handler expects a reference to an array of big-endian properties. This was implicitly t
core: interrupt: explicit dt_get_irq handler expects big endian data
Explicit that struct itr_chip::dt_get_irq handler expects a reference to an array of big-endian properties. This was implicitly told before since DTB format is big-endian.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 77c4fee6 | 24-Jan-2025 |
Etienne Carriere <etienne.carriere@foss.st.com> |
core: interrupt: fix interrupt_create_handler() description
Correct inline description comment of interrupt_create_handler() that referred deprecated API function labels dt_get_interrupt_by_*() and
core: interrupt: fix interrupt_create_handler() description
Correct inline description comment of interrupt_create_handler() that referred deprecated API function labels dt_get_interrupt_by_*() and mention argument itr_desc that was reaplce with the 2 arguments itr_chip and itr_num.
By the way, indent functions argument description for consistency with the other function inline description comments in this header file.
Fixes: e9376d025eb5 ("core: interrupt: add interrupt_create_handler()") Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| c62a7972 | 16-Sep-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: boot_mem: keep track of padding
When boot_mem_alloc() allocates memory up to alignment - 1 number of bytes may have be skipped to satisfy the required alignment of the returned pointer. If the
core: boot_mem: keep track of padding
When boot_mem_alloc() allocates memory up to alignment - 1 number of bytes may have be skipped to satisfy the required alignment of the returned pointer. If the skipped bytes, or padding, is large enough, it's recorded in a list of padding. The list of paddings can be processed and consumed with boot_mem_foreach_padding(). This allows sufficiently large paddings to be added to for instance the heap instead of being wasted.
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 ...
|
| e712be7a | 13-Sep-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: initialize guest physical memory early
Initialize guest physical memory in virt_guest_created() before the first entry into the guest from normal world. This replaces the call to core_mmu_init
core: initialize guest physical memory early
Initialize guest physical memory in virt_guest_created() before the first entry into the guest from normal world. This replaces the call to core_mmu_init_phys_mem() in init_tee_runtime().
Remove unused code in core_mmu_init_phys_mem() and the now unused functions core_mmu_get_ta_range() and virt_get_ta_ram().
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|