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
Introduce CONFIG_CUSTOM_PMP_ENTRY to enable configuring custom Physical
Memory Protection (PMP) regions directly from the Device Tree.
When this option is enabled, the PMP initialization process in
z_riscv_pmp_init() will scan the Device Tree for memory regions
tagged with the 'zephyr,memattr' property. For each such region
found, a corresponding PMP entry is programmed with the base address,
size, and permissions (R/W/X) specified in the Device Tree node.
This is facilitated by the mem_attr API.
This change allows for more flexible and hardware-specific memory
protection schemes, ideal for safeguarding critical areas like
firmware rollback segments or sensitive configuration data early in
the boot process.
Additionally, this patch introduces z_riscv_custom_pmp_entry_enable()
to manage the Machine Status Register (mstatus) MPRV bit when custom
PMP entries are used without the PMP stack guard. This function is
called during context switch to ensure correct privilege levels for
memory access.
Signed-off-by: Firas Sammoura <[email protected]>
0 commit comments