You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fw/syscall: run syscalls on the dedicated stack on ARMv7-M too
be4d98d gave App/Worker syscalls their own 2 KiB privileged stack but
only on ARMv8-M, because the relocation bounded that stack with PSPLIM.
ARMv7-M apps kept running the whole privileged call chain on their 2 KiB
task stack, and asterix reboots with StackOverflow / HardFault when a
text-heavy watchface renders a glyph that misses the cache: text layout
-> text_resources -> sys_resource_load_range -> resource_storage ->
pfs_open -> FTL -> flash consumes ~1.3 KB on top of whatever the app
already used, and the overflow happens privileged, so the kernel cannot
recover and resets.
Enable the relocation everywhere. The kernel side already handles the
missing PSPLIM; on ARMv7-M the syscall stacks get a 32 B no-access MPU
region below them instead, programmed through the free fourth per-task
slot (MemoryRegion_Task4). The fault handler treats a hit in that region
like the other stack guards, so a genuine kernel-side over-budget still
reboots with StackOverflow, while an app that runs out of its own stack
now faults unprivileged and is killed.
Verified on qemu_flint with a stress app that burns N bytes of stack and
then draws text in a custom font: with the guard alone, 512 B of extra
app usage reboots the emulator (the device failure mode); with this
change the same load succeeds (app peak 1968/2016 B, syscall stack peak
608 B) and 768 B only kills the app. WeatherGraph from the app store runs
unchanged.
Fixes FIRM-4306
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
0 commit comments