17 Commits
Author SHA1 Message Date
Harshal Patil 3632fa993a test(panic): Check that P4 flash code does not run through the uncached alias
Without PSRAM XIP, test_non_cache_irom_reg_execute_violation calls a
flash function through the uncached flash alias and expects an
instruction access fault.
2026-10-14 15:49:58 +05:30
Harshal Patil 2910e3112c test(panic): Run the PSRAM heap execute test on more targets
Run test_spiram_heap_execute_violation on every target with a PSRAM
memprot config (ESP32-C5, ESP32-C61, ESP32-P4, ESP32-H4, ESP32-S31), and
the uncached variant in both ESP32-P4 configs. Both tests allocate one
MMU page, so with PSRAM XIP the buffer comes from the main heap and not
from an alignment gap pool.
2026-10-14 15:49:57 +05:30
Harshal Patil 1ea5087de1 test(panic): Cover more ESP32-P4 memprot regions and core 1
Add ESP32-P4 rev 3 tests that execute from the PSRAM heap (cached,
uncached and the top of the heap) and from the reserved LP RAM, and that
write to the ROM through the uncached alias. Also run the flash and RTC
tests in memprot_spiram_xip_esp32p4, and four tests on core 1.

The peripheral regions get no execute tests: the hardware already
refuses instruction fetch there, so such a test cannot catch a wrong PMP
permission.
2026-10-14 15:49:55 +05:30
Harshal Patil 6b412c509c test(panic): Add P4 memprot tests for PSRAM heap and RTC code
test_non_cache_spiram_xip_heap_execute_violation executes from the
uncached alias of the PSRAM heap, which had no PMP entry before the
previous commit. test_rtc_fast_text_write_violation writes to RTC code
and fails with bootloaders that lock PMP entry 29 (v5.5.5 and v6.0.1 to
v6.1).
2026-10-14 15:49:53 +05:30
gaoxu 50a81a31f0 ci(esp32h21): enable ci target test 2026-10-09 10:58:42 +08:00
Peter Dragun b222be5d78 fix(espcoredump): Use espcoredump.py only as a simple wrapper around the esp-coredump tool
Update CI to call `esp-coredump` directly, rather than using
wrapper script.
2026-09-21 13:21:39 +02:00
Roland Dobai c43f19f44c fix(panic): pass the DUT serial port to espcoredump 2026-09-17 18:15:26 +08:00
harshal.patil 2068cd1aa0 test(panic): apply the ESP32-S2 memprot expected failures to ESP32-S3
The DRAM and RTC_FAST execute cases race the CPU exception against the PMS or
cache interrupt on ESP32-S3 too, so the panic reason is not deterministic.
2026-09-04 14:13:04 +05:30
harshal.patil 8daab867b7 test(panic): enable the memprot panic tests for ESP32-S3
sdkconfig.ci.memprot_esp32s3 was built but listed in no CONFIGS_MEMPROT_*, so
the S3 PMS panic path was never exercised.

expect_gme() takes an optional core, for panics with no attributable core.
2026-09-01 12:33:46 +05:30
harshal.patil 53c9439161 change(esp_hw_support): rework ESP32-H4 region protection to the application-owned layout
The bootloader programs only unlocked PMA entries (no PMP), so the layout is
not a bootloader<->application ABI; the application resets all entries, programs
them in ascending order from IRAM, and locks everything. Verified on ESP32-H4 v0.1.
2026-08-25 10:40:28 +05:30
harshal.patil 07debe6edc feat(esp_hw_support): Memory region protection for ESP32-H4 2026-08-25 10:40:28 +05:30
Fu Hanxi 289a17b3a2 tests: replace CLI-dependent xfail/skipif conditions 2026-08-20 09:14:41 +02:00
harshal.patil 01b86f1269 change(esp_hw_support): harden the ESP32-S31 PSRAM region permissions
Both PSRAM layouts were mapped as a single RWX window, so everything in external
RAM - the heap included - was executable.

PSRAM used as data only is now RW, and under XIP-from-PSRAM it is split per
section as ESP32-P4 does: .text RX, .rodata read-only, and the MMU-page
alignment gaps and the reclaimed heap RW, so neither is executable.

Both describe the layout that esp_psram_init() produces, and the entries are
locked, so - again as on ESP32-P4 - they are only narrowed when
CONFIG_SPIRAM_PRE_CONFIGURE_MEMORY_PROTECTION says that layout applies. Without
it the application owns the region and PSRAM stays RWX.

The per-section entries cost one PMP entry more than the 16 available, so the CPU
subsystem and peripheral windows are chained as TOR entries, taking one entry
instead of three.

soc.h is corrected against the S31 bus address map: the peripheral window base
was 1 MB too low, and the LP peripheral top, derived from a register base plus a
size rather than from the map, was 16 KB short. SOC_NON_CACHEABLE_OFFSET_FLASH
is added.
2026-08-19 09:39:52 +05:30
nilesh.kale b5891edb9b feat: enable cpu region protection for esp32s31 2026-08-17 19:23:58 +05:30
harshal.patil dc6939e583 test(esp_system): run memory protection panic tests on ESP32-P4 rev < 3.0 2026-07-29 11:41:22 +05:30
harshal.patil 64e694541b fix(panic): handle absent IROM/DROM alignment gap in spiram-xip memprot tests
The spiram-xip IROM/DROM alignment tests assumed the XIP region always
leaves an alignment gap before the next MMU page: they executed into the
gap and expected an instruction access fault followed by a register dump.
When the section ends exactly on an MMU page boundary there is no gap - the
device prints "<IROM/DROM> alignment gap not added into heap" and returns,
the framework restarts cleanly (esp_restart_noos, no panic), and the test
timed out waiting for a register dump.
2026-06-29 13:00:54 +05:30
Marius Vikhammer 6377ac3ec2 test(panic): refactor panic test to split out coredump 2026-05-15 11:00:44 +08:00