Commit be2ec6a
tests: drivers: reset: mmio: keep the fake registers out of kernel RAM
The qemu_cortex_m3 overlay placed the fake reset-mmio registers at
0x20000004/0x20000008, inside the SRAM the kernel links into. The
words they occupy are owned by whatever .data the linker places at
the start of RAM, so every write through the reset driver corrupts
live kernel state, and the test only ever passed by layout luck.
A recent timer-core change added an 8-byte .data variable that landed
at 0x20000000, which pushed libc's _char_out console output function
pointer to exactly 0x20000008: the active-low test case then wrote
its register patterns over the pointer, console output jumped through
the corrupted value into a HardFault, the fault handler's own print
re-took the fault, and QEMU stopped with "Lockup: can't escalate 3 to
HardFault". Any future .data layout change could break this test the
same way.
Shrink the kernel's view of the 64 KiB SRAM by one KiB in the overlay
and move the fake registers into the carved-out tail, so no linker
layout can ever place kernel data under them.
Assisted by Claude (claude-opus-4-8).
Signed-off-by: Anas Nashif <anas.nashif@intel.com>1 parent 4f6aebf commit be2ec6a
1 file changed
Lines changed: 22 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
1 | 19 | | |
2 | | - | |
| 20 | + | |
3 | 21 | | |
4 | | - | |
| 22 | + | |
5 | 23 | | |
6 | 24 | | |
7 | 25 | | |
8 | | - | |
| 26 | + | |
9 | 27 | | |
10 | | - | |
| 28 | + | |
11 | 29 | | |
12 | 30 | | |
13 | 31 | | |
| |||
0 commit comments