Repository navigation
memory: new memory layout - #1483
Conversation
|
@abonislawski none of the commits explain why do we need a new memory layout and what's wrong with the existing one. Please fix this. |
|
@abonislawski also this breaks CI. |
There was a problem hiding this comment.
Core 0 doesn't need to be master core - that's why we have PLATFORM_MASTER_CORE_ID.
There was a problem hiding this comment.
is this a real scenario or just a theoretical option? I can branch in this macro if core is not a PLATFORM_MASTER_CORE_ID but it will work correctly only if it is 0 (this define), just like in memmap in memory.c - it is designed for master at 0 (without my changes)
There was a problem hiding this comment.
Real scenario as there is already HW with master core != 0 (although currently not supported by SOF). I know it probably won't work due to some historical assumptions, but better not to limit the new code.
There was a problem hiding this comment.
Yes, we should not assume master == 0 in the generic xtensa arch code since the ID of the core must be unique and that is it, the actual value depends on how the cores are integrated.
We may assume it temporarily (better not, however safe atm) in the cavs platform code since we know how the cores are integrated in there.
5f26c25 to
aa91c8c
Compare
42e86c0 to
a900a74
Compare
|
Doesn't it break |
|
@jajanusz all memory layout commits squashed. One more thing, please check intel licence note in xtos-internal.h, it should be added like this? Should I add author note? And it should be also added to boot_entry.S and crt1-boards.S If I have changed only 1 line in these files? |
|
Because of recent changes on master this PR will work again when #1522 will be merged |
lgirdwood
left a comment
There was a problem hiding this comment.
No idea why you are making these changes are there are no commit messages and the PR description fails to explain why each change is needed.
"This will optimize memory usage, remove fixed position defines and allow to I will add more info to commit messages if thats not enough It introduces two significant optimizations:
|
lgirdwood
left a comment
There was a problem hiding this comment.
These are overall a good new feature, but can someone explain the programming differences (if any) between CAVS platforms and other platforms wrt buffer and other memory allocations.
This will allow to use real stack position instead of a fixed define Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
It will fix symbol overwriting _system_heap_start was already used in system_heap section Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
It will fix symbol overwriting, _system_heap_start was already used in system_heap section Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
7dcf7f7 to
95864f6
Compare
lgirdwood
left a comment
There was a problem hiding this comment.
@abonislawski thanks, I see what you are doing now. It also looks like these changes need to be reflected in memory.h where we have ASCII descriptions of the memory map.
I think the baytrail/haswell linker script changes will also need applied to imx8 linker script ?
@dbaluta fyi
It will fix symbol overwriting, _system_heap_start was already used in system_heap section Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
This will replace a fixed position define with a real linker position, which allows to set heap position by linker Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
This will add new macro to setup stack with a new memory layout when memory is separated by core Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
|
@lgirdwood sure, good point. I have updated ASCII descriptions of the memory map. Also added one commit for imx8 linker so all of them will get fix |
This will optimize memory usage and introduces two significant optimizations: > Separate the memory (heaps, stack) by cores so if we will turn off a specific core we can also turn off all memory of this core. > Remove fixed defines and gaps, previously stack was at fixed position: end of memory and buffer heap was everything between stack and fw. Now everything will be packed at sof_fw memory segment and takes only this memory which is really needed, everything else we can turn off. Changelog: BSS section now includes heaps and stack Removed many heap fixed position defines Removed gap before fw text section memmap init is using real linker positions for heaps Temporary stack for boot_ldr placed in heap_hp_buffer (safe) sof fw max_size and segment limited to memory configured by memory banks count Using new macro to stack init per core Stack is no longer a one big block for all cores (core_count*stack_size) System_runtime_heap and system_heap are no longer a one big block for all cores For suecreek memory it will also introduce similar changes previously introduced in other platforms (One shared memory block SOF_FW for SOF_TEXT, SOF_DATA and SOF_BSS sections Moved fw_ready near to .rodata and .data) Memory layout for every slave core aligned to hw memory bank: --align to memory bank-- system_heap system_runtime_heap stack --align to memory bank-- next slave core.. Similar layout applies to master core Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
|
@jajanusz @abonislawski @lgirdwood this broke Sue Creek. |
|
@lyakh Sorry we have no suecreek here and we just try to not cause CI regression. |
It introduces two significant optimizations:
BSS section now includes heaps and stack
Removed many heap fixed position defines
Removed gap before fw text section in CNL
memmap init is using real linker positions for heaps
Temporary stack for boot_ldr placed in heap_hp_buffer (safe)
use linker stack position in boot entry
use linker heap position in sanity check
sof fw max_size limited to memory configured by memory banks count
Using new macro to stack init per core
Stack is no longer a one big block for all cores (core_count*stack_size)
System_runtime_heap and system_heap are no longer a one big block for all cores
Memory layout for every slave core aligned to hw memory bank:
So if we will turn off a specific core then we are also able to turn off memory "connected" to this core
Similar layout applies to master core
Signed-off-by: Adrian Bonislawski adrian.bonislawski@linux.intel.com