From 98201228ee80a2ab187eb43392dec9be8a87fa53 Mon Sep 17 00:00:00 2001 From: Ioannis Glaropoulos Date: Mon, 11 Nov 2019 12:46:31 +0100 Subject: [PATCH] arch: enable MPU Gap filling by default in build without user mode When we build without support for user mode, we do not need a large number of MPU regions, so we should not allow having MPU_GAP_FILLING unset. This would allow PRIV code execute from SRAM, which is an unnecessary compromise on ARMv8-M builds without USERSPACE support. We update the Kconfig dependencies and add a sentence for clarification. Signed-off-by: Ioannis Glaropoulos --- arch/Kconfig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index 13afa36c800..415b76e7244 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -454,7 +454,7 @@ config MPU_REQUIRES_NON_OVERLAPPING_REGIONS config MPU_GAP_FILLING bool "Force MPU to be filling in background memory regions" depends on MPU_REQUIRES_NON_OVERLAPPING_REGIONS - depends on USERSPACE + default y if !USERSPACE help This Kconfig option instructs the MPU driver to enforce a full kernel SRAM partitioning, when it programs the @@ -466,7 +466,9 @@ config MPU_GAP_FILLING Notes: An increased number of MPU regions should only be required, - when building with USERSPACE support. + when building with USERSPACE support. As a result, when we + build without USERSPACE support, gap filling should always + be required. When the option is switched off, access to memory areas not covered by explicit MPU regions is restricted to privileged