[imm_rom_ext] Add immutable ROM_EXT ePMP reconfiguration #25310
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The immutable ROM_EXT data segment is also covered in ROM_EXT code region due to ROM limitation,
This PR let immutable ROM_EXT reconfigure ePMP first to remove executable permission on the data segment.
Jumping from IMM_ROM_EXT -> ROM / mutable ROM_EXT
We propose to use the following new ePMP layout before jumping to the mutable ROM_EXT:
MU_EXT stands for mutable part of rom_ext text segment, and IM_EXT is the immutable part.
Slot 10 will be empty if address translation is not enabled, and stack guard
is added back to slot 11.
Slot 12 and 13 are also swapped, so that the chip in production LCS has one more contiguous free entry.
Jumping from ROM_EXT -> Owner SW
Before jumping to Owner SW, all lock bits will be cleared, so all entries can
be reclaimed by Owner SW. Entries 8 ~ 11 ( &12 in prod LCS ) can be safely reconfigure by Owner SW.
Owner SW ePMP will be placed at the entries 2, 3 and 4 same as before.
When the rom_ext is linked directly to the immutable lib instead of prebuilt immutable section, the IM_EXT region (6 & 7) will covers whole ROM_EXT text section. This is the current behavior since prebuilt section is not ready yet.