diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2019-12-10 14:23:49 -0800 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2022-05-01 19:51:21 -0700 |
commit | a8f0c31fa87dcf9154c4209960f1dd1ed6a1aad8 (patch) | |
tree | d32478a51694a14cbd5c80e6768ea0869647aa88 /arch/xtensa/Kconfig | |
parent | 270a8306917e40746a02494abbd40828356b08e1 (diff) |
xtensa: noMMU: allow handling protection faults
Many xtensa CPU cores without full MMU still have memory protection
features capable of raising exceptions for invalid instruction
fetches/data access. Allow handling such exceptions. This improves
behavior of processes that pass invalid memory pointers to syscalls in
noMMU configs: in case of exception the kernel instead of killing the
process is now able to return -EINVAL from a syscall.
Introduce CONFIG_PFAULT that controls whether protection fault code is
enabled and register handlers for common memory protection exceptions
when it is enabled.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/Kconfig')
-rw-r--r-- | arch/xtensa/Kconfig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index bd113bc6e192..bca2763495a1 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig @@ -79,6 +79,7 @@ config STACKTRACE_SUPPORT config MMU def_bool n + select PFAULT config HAVE_XTENSA_GPIO32 def_bool n @@ -178,6 +179,16 @@ config XTENSA_FAKE_NMI If unsure, say N. +config PFAULT + bool "Handle protection faults" if EXPERT && !MMU + default y + help + Handle protection faults. MMU configurations must enable it. + noMMU configurations may disable it if used memory map never + generates protection faults or faults are always fatal. + + If unsure, say Y. + config XTENSA_UNALIGNED_USER bool "Unaligned memory access in user space" help |