zephyr/arch
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Hongquan Li d52d4583f5 arch: arm: cortex_a_r: smp: flush boot parameters with arch cache ops
arch_cpu_start() published the boot parameters through
sys_cache_data_flush_range(), which returns -ENOTSUP when cache
management or d-cache support is disabled.  The return value was
discarded, so a secondary core could observe stale parameters.

The AArch32 MMU setup enabled the data cache unconditionally, even
with CONFIG_DCACHE disabled, so sys_cache_data_flush_range() could
silently skip the clean while the cache was live.  Gate the SCTLR.C
bit in z_arm_mmu_init() on CONFIG_DCACHE, like soc_reset_hook() in
soc/arm/fvp_aemv8r/aarch32/soc.c already does, so that CONFIG_DCACHE=n
does not enable the data cache.

Call arch_dcache_flush_range() and check its result before releasing
the secondary core, and build cache.c for CONFIG_ARCH_CACHE or
CONFIG_DCACHE so the operation exists without cache management.  The
flush is then only needed, and only compiled, when CONFIG_DCACHE is
enabled.

Keep the existing dsync barriers; they remain the ordering point when
the flush is compiled out.  Include zephyr/arch/cache.h directly
because zephyr/cache.h only exposes the arch cache interface when a
cache type is selected.

This only avoids setting SCTLR.C; a C bit left set by an earlier boot
stage is not cleared.

Fixes #119663

Signed-off-by: Hongquan Li <hongquan.li@processmission.com>
2026-10-30 12:48:58 -04:00
..
arc arch: arc: use k_thread_is_user_thread() 2026-10-29 17:34:11 -04:00
arm arch: arm: cortex_a_r: smp: flush boot parameters with arch cache ops 2026-10-30 12:48:58 -04:00
arm64 arch: arm64: smp: clean boot parameters with arch cache ops 2026-10-30 12:48:58 -04:00
common arch: common: nocache.ld: move MPU padding to a NOLOAD section 2026-10-15 14:24:09 +02:00
hexagon arch: hexagon: add userspace support 2026-10-28 22:35:04 -04:00
mips arch: mips: support building without generated SW ISR table 2026-09-26 08:40:33 +02:00
openrisc arch: openrisc: support building without generated SW ISR table 2026-09-26 08:40:33 +02:00
posix arch/posix: Export native target architecture as cache variable 2026-09-23 19:20:33 +02:00
riscv arch: riscv: use k_thread_is_user_thread() 2026-10-29 17:34:11 -04:00
rx arch: rx: Add new RXv3e core support for RX74 devices 2026-09-28 19:40:02 -04:00
sparc arch: {arm, common, sparc, x86, xtensa}: fix typo 2026-10-06 22:39:13 +02:00
tricore arch: tricore: add arch_float_disable and arch_float_enable 2026-10-28 22:54:30 -04:00
x86 arch: x86: use k_thread_is_user_thread() 2026-10-29 17:34:11 -04:00
xtensa xtensa: check BSA bounds before printing fatal exception 2026-10-29 19:44:22 -04:00
archs.yml arch: add TriCore architecture support 2026-09-18 11:13:16 +01:00
CMakeLists.txt cmake: enable -Wshadow partially for in-tree code 2023-08-22 11:39:58 +02:00
hardening.yaml scripts: kconfig: hardenconfig: switch to YAML hardening database 2026-09-29 10:40:32 +02:00
Kconfig arch: x86, xtensa: select BARRIER_OPERATIONS_BUILTIN 2026-10-29 19:44:13 -04:00