| 00338334 | 31-Oct-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: support dynamic protected memory lending
With CFG_CORE_DYN_PROTMEM=y support dynamic protected memory lending.
A new internal struct mobj_ffa_rsm is added to handle dynamic protected memory f
core: support dynamic protected memory lending
With CFG_CORE_DYN_PROTMEM=y support dynamic protected memory lending.
A new internal struct mobj_ffa_rsm is added to handle dynamic protected memory for FF-A.
A new internal struct mobj_protmem is add to handle dynamic protected memory without FF-A.
Lending non-secure memory to OP-TEE to use it as protected memory means that it should to become inaccessible by the normal world as part of the process. This part is currently not supported, since it must be done in a platform specific way for platforms that support that. QEMU don't support that.
Adding two platform specific functions, plat_get_protmem_config() and plat_set_protmem_range() for dynamic protected memory. The functions has __weak implementation to allow easier testing. However, plat_set_protmem_range() requires CFG_INSECURE=y since it doesn't change memory protection.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 46195e2f | 14-Nov-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: arm: refactor struct mobj_ffa
Moves the non-secure shared memory specific fields of struct mobj_ffa into the new struct mobj_ffa_shm which in turn embeds struct mobj_ffa.
This prepares for an
core: arm: refactor struct mobj_ffa
Moves the non-secure shared memory specific fields of struct mobj_ffa into the new struct mobj_ffa_shm which in turn embeds struct mobj_ffa.
This prepares for another derivate of struct mobj_ffa that deals with another kind of memory.
No change in functionality.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| 232f1cde | 08-Mar-2025 |
Yu-Chien Peter Lin <peter.lin@sifive.com> |
core: mm: refactor ASLR mapping for architecture support
To allow adding RISC-V ASLR support, add arch_aslr_base_addr() which will be used to apply architecture specific ASLR base calculation.
Sign
core: mm: refactor ASLR mapping for architecture support
To allow adding RISC-V ASLR support, add arch_aslr_base_addr() which will be used to apply architecture specific ASLR base calculation.
Signed-off-by: Yu-Chien Peter Lin <peter.lin@sifive.com> Suggested-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Alvin Chang <alvinga@andestech.com>
show more ...
|
| 6a2e17e9 | 20-Mar-2025 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: mm: shared xlat tables for NEX_DYN_VASPACE
Mappings in MEM_AREA_NEX_DYN_VASPACE belong to the nexus and are must to be the same for all partitions. Since these mappings must be updated in the
core: mm: shared xlat tables for NEX_DYN_VASPACE
Mappings in MEM_AREA_NEX_DYN_VASPACE belong to the nexus and are must to be the same for all partitions. Since these mappings must be updated in the partitions after the MMU has been enabled. Partitions share translation tables for this mappings, so we only need to update in one translation table when adding or removing mappings.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 13b4cbd1 | 20-Mar-2025 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: arm: mm: fix core_mmu_xlat_table_alloc() for nexus
core_mmu_xlat_table_alloc() allocates new translation tables from boot_mem until during early boot and after the MMU has been enabled with ne
core: arm: mm: fix core_mmu_xlat_table_alloc() for nexus
core_mmu_xlat_table_alloc() allocates new translation tables from boot_mem until during early boot and after the MMU has been enabled with nex_phys_mem_core_alloc() or phys_mem_core_alloc(). However, the logic selecting which function to call doesn't take the default partition into account. The default partition has only a nexus physical memory pool so nex_phys_mem_core_alloc() must be called if that partition is active. So fix the problem with an extra check for default_partition.
Fixes: a28e4a0fe48d ("core: arm: mm: dynamic allocation of LPAE translation tables") 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 ...
|
| 96f43358 | 26-Feb-2025 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: add nex_dyn_vaspace and tee_dyn_vaspace areas
Add MEM_AREA_NEX_DYN_VASPACE and MEM_AREA_TEE_DYN_VASPACE areas for dynamic Nexus and TEE memory mapping. This will be used to map additional heap
core: add nex_dyn_vaspace and tee_dyn_vaspace areas
Add MEM_AREA_NEX_DYN_VASPACE and MEM_AREA_TEE_DYN_VASPACE areas for dynamic Nexus and TEE memory mapping. This will be used to map additional heap and the stacks in later patches.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 30686e1e | 17-Feb-2025 |
Gatien Chevallier <gatien.chevallier@foss.st.com> |
core: fix debug event fault value for ARM32 with LPAE
According to ARM documentation, the debug event fault value is indeed 0b100010, which is 0x22, not 0x12. Fix this value in core_mmu_get_fault_ty
core: fix debug event fault value for ARM32 with LPAE
According to ARM documentation, the debug event fault value is indeed 0b100010, which is 0x22, not 0x12. Fix this value in core_mmu_get_fault_type().
Fixes: 0eff3e9bf016 ("arm32: Adds LPAE support") Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
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 ...
|
| 873f5f6c | 12-Feb-2025 |
Mark Zhang <markz@nvidia.com> |
core: mmu: Add dynamic VA regions' mapping to page table
When optee boots, the initial mapping for MEM_AREA_RES_VASPACE and MEM_AREA_SHM_VASPACE should be added into page tables and replicated to al
core: mmu: Add dynamic VA regions' mapping to page table
When optee boots, the initial mapping for MEM_AREA_RES_VASPACE and MEM_AREA_SHM_VASPACE should be added into page tables and replicated to all CPU cores too. This fixes an issue when the VA of MEM_AREA_RES_VASPACE or MEM_AREA_SHM_VASPACE is not in a same 1GB region with other memory regions.
Link: https://github.com/OP-TEE/optee_os/issues/7275 Signed-off-by: Mark Zhang <markz@nvidia.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 7d0f479e | 16-Sep-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: arm: mm: dynamic allocation of v7 translation tables
With CFG_DYN_CONFIG enabled allocate translation tables using the boot_mem_*() functions. Static allocation from global variables is still
core: arm: mm: dynamic allocation of v7 translation tables
With CFG_DYN_CONFIG enabled allocate translation tables using the boot_mem_*() functions. Static allocation from global variables is still used with CFG_DYN_CONFIG disabled.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| a28e4a0f | 09-Jul-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: arm: mm: dynamic allocation of LPAE translation tables
With CFG_DYN_CONFIG enabled allocate translation tables using the boot_mem_*() functions. Static allocation from global variables is stil
core: arm: mm: dynamic allocation of LPAE translation tables
With CFG_DYN_CONFIG enabled allocate translation tables using the boot_mem_*() functions. Static allocation from global variables is still used with CFG_DYN_CONFIG disabled.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 18715752 | 09-Jul-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: arm: mm: refactor LPAE translation table handling
Refactor translation table handling to use a more flexible layout of the translation tables in memory. Instead of relying on multidimensional
core: arm: mm: refactor LPAE translation table handling
Refactor translation table handling to use a more flexible layout of the translation tables in memory. Instead of relying on multidimensional array use helper functions to calculate the address of each translation table as needed.
Preparing for future changes, no change in behaviour.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 04e46975 | 16-Dec-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
tree-wide: use ROUNDUP_DIV() where applicable
Use ROUNDUP_DIV() instead of ROUNDUP(..., size) / size where applicable.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Je
tree-wide: use ROUNDUP_DIV() where applicable
Use ROUNDUP_DIV() instead of ROUNDUP(..., size) / size where applicable.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| fa03dcc0 | 14-Sep-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: arm: core_mmu_v7.c: increase MAX_XLAT_TABLES by 2
Increase MAX_XLAT_TABLES by 2 to be able to map all TEE memory with 4k pages.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Revie
core: arm: core_mmu_v7.c: increase MAX_XLAT_TABLES by 2
Increase MAX_XLAT_TABLES by 2 to be able to map all TEE memory with 4k pages.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| b1e25277 | 14-Aug-2024 |
Yu Chien Peter Lin <peterlin@andestech.com> |
core: mm: core_mmu: add core_mmu_user_va_range_is_defined() for RISC-V
The function hasn't been implemented for RISC-V, so move the core_mmu_user_va_range_is_defined() definition to generic core_mmu
core: mm: core_mmu: add core_mmu_user_va_range_is_defined() for RISC-V
The function hasn't been implemented for RISC-V, so move the core_mmu_user_va_range_is_defined() definition to generic core_mmu.h and function implementations to arch-specific files.
Also, update the assertions where checks if user va range is defined.
Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com> Reviewed-by: Alvin Chang <alvinga@andestech.com> Tested-by: Alvin Chang <alvinga@andestech.com> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| b8ef8d0b | 08-May-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: mm: introduce struct memory_map
Introduce struct memory_map to keep track of the array of struct tee_mmap_region, covering number of used entries and number of allocated entries.
core_mmap_is
core: mm: introduce struct memory_map
Introduce struct memory_map to keep track of the array of struct tee_mmap_region, covering number of used entries and number of allocated entries.
core_mmap_is_end_of_table() and MEM_AREA_END are now unused so remove them.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| d8e39169 | 26-Jun-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: arm: mmu_v7: remove non-working ns-virtualization
Removes the nonworking CFG_NS_VIRTUALIZATION code from core_mmu_v7.c.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by:
core: arm: mmu_v7: remove non-working ns-virtualization
Removes the nonworking CFG_NS_VIRTUALIZATION code from core_mmu_v7.c.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 196c08bb | 23-Jun-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: arm: mm: remove unused map_memarea_sections()
Remove the unused function map_memarea_sections().
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etien
core: arm: mm: remove unused map_memarea_sections()
Remove the unused function map_memarea_sections().
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| b70970fe | 25-Jun-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
core: arm: fix calloc() against GCC 14 -Wcalloc-transposed-args
Fix calloc() calls against GCC 14 directive -Wcalloc-transposed-args that makes GCC to complain with an warning/error trace message li
core: arm: fix calloc() against GCC 14 -Wcalloc-transposed-args
Fix calloc() calls against GCC 14 directive -Wcalloc-transposed-args that makes GCC to complain with an warning/error trace message like:
warning: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
No functional change.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com> Acked-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| fdf696b7 | 12-Jun-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: rename tee_mm_shm to core_virt_shm_pool
Rename tee_mm_shm to core_virt_shm_pool to make it clear that it handles virtual memory allocations for shared memory.
Signed-off-by: Jens Wiklander <j
core: rename tee_mm_shm to core_virt_shm_pool
Rename tee_mm_shm to core_virt_shm_pool to make it clear that it handles virtual memory allocations for shared memory.
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 ...
|
| 9b0ee59d | 12-Jun-2024 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: rename tee_mm_vcore to core_virt_mem_pool
Rename tee_mm_vcore to core_virt_mem_pool to make it clear that it handles virtual memory allocations.
Signed-off-by: Jens Wiklander <jens.wiklander@
core: rename tee_mm_vcore to core_virt_mem_pool
Rename tee_mm_vcore to core_virt_mem_pool to make it clear that it handles virtual memory allocations.
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 ...
|
| e92be0c6 | 23-Feb-2024 |
Alvin Chang <alvinga@andestech.com> |
core: mm: move mobj_dyn_shm.c to mm
To enable RISC-V platforms to utilize dynamic shared memory, relocate the non-architecture-specific mobj_dyn_shm.c to the mm directory.
Signed-off-by: Alvin Chan
core: mm: move mobj_dyn_shm.c to mm
To enable RISC-V platforms to utilize dynamic shared memory, relocate the non-architecture-specific mobj_dyn_shm.c to the mm directory.
Signed-off-by: Alvin Chang <alvinga@andestech.com> Reviewed-by: Yu Chien Peter Lin <peterlin@andestech.com> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
show more ...
|
| ae9b4197 | 22-May-2024 |
Gatien Chevallier <gatien.chevallier@foss.st.com> |
core: pager: fix arguments passed to calloc in alloc_merged_pgt_array()
An error was reported when compiling with GCC14 on this calloc:
core/arch/arm/mm/tee_pager.c: In function 'alloc_merged_pgt_a
core: pager: fix arguments passed to calloc in alloc_merged_pgt_array()
An error was reported when compiling with GCC14 on this calloc:
core/arch/arm/mm/tee_pager.c: In function 'alloc_merged_pgt_array': core/arch/arm/mm/tee_pager.c:934:35: warning: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Wcalloc-transposed-args] 934 | pgt_array = calloc(sizeof(struct pgt *), pgt_count); | ^~~~~~
Looking at the code, it seems that pgt_count and sizeof(struct pgt *) are inverted.
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com> Fixes: 60e367146042 ("core: pager fix alloc_merged_pgt_array()") Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 21773c96 | 02-Mar-2024 |
Etienne Carriere <etienne.carriere@foss.st.com> |
core: arm: mm: use thread_unmask_exceptions() where applicable
Change cache_op_outer() to use thread_unmask_exceptions() instead of thread_set_exceptions() as the function unmasks interruptions it p
core: arm: mm: use thread_unmask_exceptions() where applicable
Change cache_op_outer() to use thread_unmask_exceptions() instead of thread_set_exceptions() as the function unmasks interruptions it previously masked with thread_set_exceptions(). This change makes the implementation more consistent.
No functional change.
Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Signed-off-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 ...
|