ARM: mm: Add kernel parameter for imprecise abort handling
Subsystems (2)
PATCH v2 1/1 ARM: mm: Add kernel parameter for imprecise abort handling
When we receive an imprecise abort it is possible that the currently running task did not cause it - it could be from an external bus bridge or another device causing a fault on the bus.
Historically we've always signalled the current task anyway, but depending on the platform and stage of development it may be more appropriate to log and continue or to panic.
Add a kernel parameter to choose between these 3 options.
Based on work by Ben Dooks.
Signed-off-by Ben Hutchings <[email protected]>
--- Documentation/kernel-parameters.txt | 5 ++++ arch/arm/mm/fault.c | 53 +++++++++++++++++++++++++++++++++++++ arch/arm/mm/fsr-2level.c | 32 +++++++++++----------- arch/arm/mm/fsr-3level.c | 2 +- 4 files changed, 75 insertions(+), 17 deletions(-)
Documentation/kernel-parameters.txt +5 -0
@@ -1430,6 +1430,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted. different crypto accelerators. This option can be used to achieve best performance for particular HW. + imp_abort= [KNL,ARM] + Set behaviour in case of an imprecise abort. + Format: { "log" | "signal" | "panic" } + Default: "signal" + init= [KNL] Format: <full_path> Run specified binary instead of /sbin/init as init
arch/arm/mm/fault.c +53 -0
59 lines not on this page · raw message
arch/arm/mm/fsr-2level.c +16 -16
@@ -24,22 +24,22 @@ static struct fsr_info fsr_info[] = {* 10 of the FSR, and may not be recoverable. These are only * supported if the CPU abort handler supports bit 10. */ - { do_bad, SIGBUS, 0, "unknown 16" }, - { do_bad, SIGBUS, 0, "unknown 17" }, - { do_bad, SIGBUS, 0, "unknown 18" }, - { do_bad, SIGBUS, 0, "unknown 19" }, - { do_bad, SIGBUS, 0, "lock abort" }, /* xscale */ - { do_bad, SIGBUS, 0, "unknown 21" }, - { do_bad, SIGBUS, BUS_OBJERR, "imprecise external abort" }, /* xscale */ - { do_bad, SIGBUS, 0, "unknown 23" }, - { do_bad, SIGBUS, 0, "dcache parity error" }, /* xscale */ - { do_bad, SIGBUS, 0, "unknown 25" }, - { do_bad, SIGBUS, 0, "unknown 26" }, - { do_bad, SIGBUS, 0, "unknown 27" }, - { do_bad, SIGBUS, 0, "unknown 28" }, - { do_bad, SIGBUS, 0, "unknown 29" }, - { do_bad, SIGBUS, 0, "unknown 30" }, - { do_bad, SIGBUS, 0, "unknown 31" }, + { do_bad_imprecise, SIGBUS, 0, "unknown 16" }, + { do_bad_imprecise, SIGBUS, 0, "unknown 17" }, + { do_bad_imprecise, SIGBUS, 0, "unknown 18" }, + { do_bad_imprecise, SIGBUS, 0, "unknown 19" }, + { do_bad_imprecise, SIGBUS, 0, "lock abort" }, /* xscale */ + { do_bad_imprecise, SIGBUS, 0, "unknown 21" }, + { do_bad_imprecise, SIGBUS, BUS_OBJERR, "imprecise external abort" }, /* xscale */ + { do_bad_imprecise, SIGBUS, 0, "unknown 23" }, + { do_bad_imprecise, SIGBUS, 0, "dcache parity error" }, /* xscale */ + { do_bad_imprecise, SIGBUS, 0, "unknown 25" }, + { do_bad_imprecise, SIGBUS, 0, "unknown 26" }, + { do_bad_imprecise, SIGBUS, 0, "unknown 27" }, + { do_bad_imprecise, SIGBUS, 0, "unknown 28" }, + { do_bad_imprecise, SIGBUS, 0, "unknown 29" }, + { do_bad_imprecise, SIGBUS, 0, "unknown 30" }, + { do_bad_imprecise, SIGBUS, 0, "unknown 31" }, }; static struct fsr_info ifsr_info[] = {
arch/arm/mm/fsr-3level.c +1 -1
@@ -16,7 +16,7 @@ static struct fsr_info fsr_info[] = { { do_page_fault, SIGSEGV, SEGV_ACCERR, "level 2 permission fault" }, { do_page_fault, SIGSEGV, SEGV_ACCERR, "level 3 permission fault" }, { do_bad, SIGBUS, 0, "synchronous external abort" }, - { do_bad, SIGBUS, 0, "asynchronous external abort" }, + { do_bad_imprecise, SIGBUS, 0, "asynchronous external abort" }, { do_bad, SIGBUS, 0, "unknown 18" }, { do_bad, SIGBUS, 0, "unknown 19" }, { do_bad, SIGBUS, 0, "synchronous abort (translation table walk)" },
Signature · 1 line
2.1.4