soc: arm: xilinx_zynqmp: Add "Execute Never" MPU flag to non-code RAM

Executing from RAM sections other than rom/code should cause a fault.
This is tested as part of the kernel mem_protect tests.

Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
This commit is contained in:
Grant Ramsay 2024-01-28 11:51:13 +13:00 committed by David Leach
commit 211ddf1c7e

View file

@ -22,11 +22,12 @@
| MPU_RASR_B_Msk) \ | MPU_RASR_B_Msk) \
} }
#define MPUTYPE_PRIV_WBWACACHE \ #define MPUTYPE_PRIV_WBWACACHE_XN \
{ \ { \
.rasr = (P_RW_U_NA_Msk \ .rasr = (P_RW_U_NA_Msk \
| (5 << MPU_RASR_TEX_Pos) \ | (5 << MPU_RASR_TEX_Pos) \
| MPU_RASR_B_Msk) \ | MPU_RASR_B_Msk \
| MPU_RASR_XN_Msk) \
} }
#define MPUTYPE_PRIV_DEVICE \ #define MPUTYPE_PRIV_DEVICE \
@ -45,7 +46,7 @@ static const struct arm_mpu_region mpu_regions[] = {
MPU_REGION_ENTRY("SRAM_PRIV", MPU_REGION_ENTRY("SRAM_PRIV",
0x00000000, 0x00000000,
REGION_2G, REGION_2G,
MPUTYPE_PRIV_WBWACACHE), MPUTYPE_PRIV_WBWACACHE_XN),
MPU_REGION_ENTRY("SRAM", MPU_REGION_ENTRY("SRAM",
0x00000000, 0x00000000,