From 58b035b85fcbbaff427d5a72ec5b21fadd02e1b1 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Wed, 9 Apr 2025 12:13:55 -0700 Subject: [PATCH] soc: intel_adsp/ace: linker: align cpuhold_* variables For some weird unknown reasons, the simulator really do not like the cpuhold_* variables to be tightly packed together. This results in cpuhold_spawned not being updated, and we will be stuck in the while loop for it to be set. Workaround this by explicitly aligning these variables on 16 byte boundary. This seems to work for now. Signed-off-by: Daniel Leung --- soc/intel/intel_adsp/ace/ace-link.ld | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/soc/intel/intel_adsp/ace/ace-link.ld b/soc/intel/intel_adsp/ace/ace-link.ld index 2c9a551a4dd..aa92a212ea0 100644 --- a/soc/intel/intel_adsp/ace/ace-link.ld +++ b/soc/intel/intel_adsp/ace/ace-link.ld @@ -505,6 +505,24 @@ SECTIONS { .bss SEGSTART_UNCACHED (NOLOAD) : { _bss_start = .; + +#if defined(CONFIG_ZTEST) && defined(CONFIG_SIMULATOR_XTENSA) + /* For some weird unknown reasons, the simulator really do not + * like these cpuhold_* variables to be tightly packed together. + * This results in cpuhold_spawned not being updated, and we + * will be stuck in the while loop for it to be set. + * Workaround by explicitly aligning these variables. + */ + . = ALIGN(16); + *:ztest.c.obj(.bss.cpuhold_sem) + . = ALIGN(16); + *:ztest.c.obj(.bss.cpuhold_active) + . = ALIGN(16); + *:ztest.c.obj(.bss.cpuhold_spawned) + . = ALIGN(16); + *:ztest.c.obj(.bss.cpuhold_pool_items) +#endif /* CONFIG_ZTEST && CONFIG_SIMULATOR_XTENSA */ + *(.dynsbss) *(.sbss) *(.sbss.*)