Skip to content

Conversation

@fsammoura1980
Copy link
Contributor

Adds the Kconfig option PMP_NO_LOCK to remove the PMP Lock bit usage. The global entry is an internal detail of the driver implementation and should not be reflected in the user interface. This allows the application to dynamically reconfigure the PMP entries without requiring hard reset. This is essential for firmware that performs an RO-to-RW jump. By keeping these system entries unlocked, higher-privileged M-mode code can dynamically reconfigure memory permissions during the secure handover process, which is not possible if the entries are permanently locked during early boot.

Adds four new test cases to validate the PMP stack guard protection when CONFIG_PMP_NO_LOCK is enabled (i.e., when PMP entries are not globally locked).

@zephyrbot zephyrbot added area: Tests Issues related to a particular existing or missing test area: RISCV RISCV Architecture (32-bit & 64-bit) labels Nov 17, 2025
@fsammoura1980 fsammoura1980 force-pushed the custom_pmp_plus_unlocked_entries branch from 08ba164 to e96d030 Compare November 17, 2025 16:45
@fsammoura1980 fsammoura1980 changed the title Custom pmp plus unlocked entries PMP global unlocked entries Nov 17, 2025
@fsammoura1980 fsammoura1980 changed the title PMP global unlocked entries riscv: pmp: Add support for unlocked global PMP entries Nov 17, 2025
@fsammoura1980 fsammoura1980 force-pushed the custom_pmp_plus_unlocked_entries branch from e96d030 to 8599ea1 Compare November 19, 2025 04:02
@fsammoura1980 fsammoura1980 force-pushed the custom_pmp_plus_unlocked_entries branch from 8599ea1 to 5b18200 Compare November 19, 2025 05:55
Adds the Kconfig option PMP_NO_LOCK to remove the PMP Lock bit usage.
The global entry is an internal detail of the driver implementation and
should not be reflected in the user interface. This allows the
application to dynamically reconfigure the PMP entries without requiring
hard reset. This is essential for firmware that performs an RO-to-RW
jump. By keeping these system entries unlocked, higher-privileged M-mode
code can dynamically reconfigure memory permissions during the secure
handover process, which is not possible if the entries are permanently
locked during early boot.

Signed-off-by: Firas Sammoura <[email protected]>
Adds four new test cases to validate the PMP stack guard protection when
`CONFIG_PMP_NO_LOCK` is enabled (i.e., when PMP entries are not globally
locked).

Signed-off-by: Firas Sammoura <[email protected]>
@fsammoura1980 fsammoura1980 force-pushed the custom_pmp_plus_unlocked_entries branch from 5b18200 to 373d22b Compare November 19, 2025 05:56
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: RISCV RISCV Architecture (32-bit & 64-bit) area: Tests Issues related to a particular existing or missing test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants