Skip to content
Permalink
Browse files

arch: arm: allow user to fall-back to MPU-based guards in ARMv8-M

ARMv8-M architecture supports the built-in stack overflow
detection mechanisms via the SPLIM registers. However, the
user might still wish to use the traditional MPU-based stack
overflow detection mechanism (for testing or other reasons).
We now allow the user to enable HW stack protection, but
manually turn off BUILTIN_STACK_GUARD option. This will force
the MPU_STACK_GUARD option to be selected.

It is still not allowed for the user to not select any stack
guard mechanisms, if HW_STACK_PROTECTION is selected.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
  • Loading branch information...
ioannisg authored and andrewboie committed Jun 30, 2019
1 parent e8f2d86 commit 9b03cd8bdcee41c448f85f8dd1ef1c268f9fa102
Showing with 4 additions and 2 deletions.
  1. +4 −2 arch/arm/core/Kconfig
@@ -39,7 +39,7 @@ config BUILTIN_STACK_GUARD
config ARM_STACK_PROTECTION
bool
default y if HW_STACK_PROTECTION
select BUILTIN_STACK_GUARD if CPU_CORTEX_M_HAS_SPLIM
imply BUILTIN_STACK_GUARD if CPU_CORTEX_M_HAS_SPLIM
select MPU_STACK_GUARD if (!BUILTIN_STACK_GUARD && ARM_MPU)
help
This option enables either:
@@ -49,7 +49,9 @@ config ARM_STACK_PROTECTION
if the bounds of the current process stack are overflowed.
The two stack guard options are mutually exclusive. The
selection of the built-in Stack Pointer limit checking is
prioritized over the MPU-based stack guard.
prioritized over the MPU-based stack guard. The developer
still has the option to manually select the MPU-based
stack guard, if this is desired.

config ARM_SECURE_FIRMWARE
bool

0 comments on commit 9b03cd8

Please sign in to comment.
You can’t perform that action at this time.