arch/arm: Make MPU stack guard large enough to hold an exception frame
arch/arm: Make MPU stack guard large enough to hold an exception frame

When a stack overflow is caught by an MPU region, the stack pointer will
end up inside that area when the exception is handled. Handling the
exception involves pushing an exception frame onto the same stack. If
there's not enough space remaining below the faulting SP value, the
memory region below the stack will get corrupted.

We protect against this by making the stack guard larger than the 0x20
bytes necessary to hold an exception frame. To avoid lots of conditional
complexity here, the guard is set to 0x40 bytes if the MPU minimum size
is not larger than 0x20 bytes.

Signed-off-by: Keith Packard <fd7f967895e9f35e58ec8a62a847a54d7fa7275f@keithp.com>

zephyrproject-rtos/zephyr,galak/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,galak/zephyr,galak/zephyr,finikorg/zephyr,finikorg/zephyr,finikorg/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr