| 0f3e22bd | 17-Jun-2025 |
Aleksandr Iashchenko <aleksandr.iashchenko@linutronix.de> |
libutils: drop redundant IS_ENABLED checks
The functions asan_tag_access() and asan_tag_heap_free() are always defined. When CFG_CORE_SANITIZE_KADDRESS is disabled, they are compiled as no-ops. Thus
libutils: drop redundant IS_ENABLED checks
The functions asan_tag_access() and asan_tag_heap_free() are always defined. When CFG_CORE_SANITIZE_KADDRESS is disabled, they are compiled as no-ops. Thus, the surrounding IS_ENABLED() checks are unnecessary and removed.
Signed-off-by: Aleksandr Iashchenko <aleksandr.iashchenko@linutronix.de> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| ffe211e0 | 17-Jun-2025 |
Aleksandr Iashchenko <aleksandr.iashchenko@linutronix.de> |
libutils: tag only actual allocated size in ASan heap tagging
Tag exactly the requested allocation size (hdr_size + requested_size) instead of the rounded-up buffer size. This ensures that ASan does
libutils: tag only actual allocated size in ASan heap tagging
Tag exactly the requested allocation size (hdr_size + requested_size) instead of the rounded-up buffer size. This ensures that ASan does not mark extra padding as valid memory.
Signed-off-by: Aleksandr Iashchenko <aleksandr.iashchenko@linutronix.de> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
show more ...
|
| 682ff6eb | 23-Feb-2025 |
Jens Wiklander <jens.wiklander@linaro.org> |
pta: stats: add field for fragmentation metric
Add the field free2sum to struct pta_stats_alloc to enable xtest to calculate fragmenation metric for the heap.
Signed-off-by: Jens Wiklander <jens.wi
pta: stats: add field for fragmentation metric
Add the field free2sum to struct pta_stats_alloc to enable xtest to calculate fragmenation metric for the heap.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Acked-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| 07603a1f | 01-Apr-2025 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: avoid unneeded zero init in realloc()
In raw_malloc_flags(), remove the special case for user space where memory is always zero initialized regardless of MAF_ZERO_INIT. This removes a case
libutils: avoid unneeded zero init in realloc()
In raw_malloc_flags(), remove the special case for user space where memory is always zero initialized regardless of MAF_ZERO_INIT. This removes a case of unneeded zero init for realloc().
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 ...
|
| 1baf19de | 26-Feb-2025 |
Jens Wiklander <jens.wiklander@linaro.org> |
core: mm: add phys_mem_alloc_flags()
Add phys_mem_alloc_flags() taking MAF_* flags to control memory allocation. The new flag MAF_CORE_MEM behaves like {nex_,}phys_mem_core_alloc(), if the flag is
core: mm: add phys_mem_alloc_flags()
Add phys_mem_alloc_flags() taking MAF_* flags to control memory allocation. The new flag MAF_CORE_MEM behaves like {nex_,}phys_mem_core_alloc(), if the flag is absent it becomes {nex_,}phys_mem_ta_alloc().
The MAF_NEX flag selects Nexus memory.
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Reviewed-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|
| edc125c5 | 20-Jan-2025 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: add malloc_flags() and free_flags()
Add malloc_flags() and free_flags() for generic and flexible memory allocations based on a passed flags field.
Signed-off-by: Jens Wiklander <jens.wikl
libutils: add malloc_flags() and free_flags()
Add malloc_flags() and free_flags() for generic and flexible memory allocations based on a passed flags field.
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 ...
|
| 695be9d6 | 20-Jan-2025 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: refactor the MDBG malloc functions
Replace the MDBG malloc functions and macros with a new function __mdbg_alloc() handling all the memory allocations similar to mem_alloc(). The old MDBG
libutils: refactor the MDBG malloc functions
Replace the MDBG malloc functions and macros with a new function __mdbg_alloc() handling all the memory allocations similar to mem_alloc(). The old MDBG macros are replace by new macros calling __mdbg_alloc().
mem_alloc(), mem_alloc_unlocked(), and mem_free() are updated to handle configuration with and without MDBG, removing the all the ENABLE_MDBG ifdefs in the C file.
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 ...
|
| 46452164 | 20-Jan-2025 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: refactor the nexus malloc functions
Refactor the malloc functions operating on the nexus heap as simple wrappers around the recently added internal function mem_alloc().
Signed-off-by: Je
libutils: refactor the nexus malloc functions
Refactor the malloc functions operating on the nexus heap as simple wrappers around the recently added internal function mem_alloc().
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 ...
|
| 07c190fb | 20-Jan-2025 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: refactor the default malloc functions
Refactor the malloc functions operating on the default heap as simple wrappers around the new internal function mem_alloc() similar to the recently ad
libutils: refactor the default malloc functions
Refactor the malloc functions operating on the default heap as simple wrappers around the new internal function mem_alloc() similar to the recently added raw_mem_alloc().
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 ...
|
| 46493333 | 20-Jan-2025 |
Jens Wiklander <jens.wiklander@linaro.org> |
libutils: refactor raw malloc functions
Refactor the raw malloc functions as simple wrappers around the new internal function raw_mem_alloc(). raw_mem_alloc() takes a flags field to control whether
libutils: refactor raw malloc functions
Refactor the raw malloc functions as simple wrappers around the new internal function raw_mem_alloc(). raw_mem_alloc() takes a flags field to control whether the allocated buffer should be cleared before it's returned.
The flags are defined in <malloc.h> since they will be needed there in later patches.
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 ...
|
| a05577ea | 23-Nov-2023 |
Etienne Carriere <etienne.carriere@foss.st.com> |
tree wide: clarify PTA ABI
Explicitly describe the statistics PTA ABI using dedicated inline comments and moving struct pta_stats_ta and struct pta_stats_alloc from respectively tee_ta_manager.c and
tree wide: clarify PTA ABI
Explicitly describe the statistics PTA ABI using dedicated inline comments and moving struct pta_stats_ta and struct pta_stats_alloc from respectively tee_ta_manager.c and malloc.h to pta_stats.h header file.
For that purpose, define ALLOC_ID_* macros to identify each allocator one can query information from through the statistics PTA API.
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org> Acked-by: Jerome Forissier <jerome.forissier@linaro.org> Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
show more ...
|