]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
arm64/BUG: Use BRK instruction for generic BUG traps
authorDave P Martin <Dave.Martin@arm.com>
Fri, 24 Jul 2015 15:37:48 +0000 (16:37 +0100)
committerWill Deacon <will.deacon@arm.com>
Mon, 27 Jul 2015 10:08:42 +0000 (11:08 +0100)
commit9fb7410f955f7a62c1f882ca8f9ffd4525907e28
tree1a3da5d5b35c0cff97fea27331cdd25e7bd58c58
parentd7a33f4fbd12ca0a32a24cc46c0d02b47f6b54d1
arm64/BUG: Use BRK instruction for generic BUG traps

Currently, the minimal default BUG() implementation from asm-
generic is used for arm64.

This patch uses the BRK software breakpoint instruction to generate
a trap instead, similarly to most other arches, with the generic
BUG code generating the dmesg boilerplate.

This allows bug metadata to be moved to a separate table and
reduces the amount of inline code at BUG and WARN sites.  This also
avoids clobbering any registers before they can be dumped.

To mitigate the size of the bug table further, this patch makes
use of the existing infrastructure for encoding addresses within
the bug table as 32-bit offsets instead of absolute pointers.
(Note that this limits the kernel size to 2GB.)

Traps are registered at arch_initcall time for aarch64, but BUG
has minimal real dependencies and it is desirable to be able to
generate bug splats as early as possible.  This patch redirects
all debug exceptions caused by BRK directly to bug_handler() until
the full debug exception support has been initialised.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/Kconfig
arch/arm64/include/asm/bug.h [new file with mode: 0644]
arch/arm64/include/asm/debug-monitors.h
arch/arm64/kernel/traps.c
arch/arm64/mm/fault.c