]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: consistently use bl for C exception entry
authorMark Rutland <mark.rutland@arm.com>
Wed, 26 Jul 2017 10:14:53 +0000 (11:14 +0100)
committerMark Rutland <mark.rutland@arm.com>
Tue, 8 Aug 2017 15:28:24 +0000 (16:28 +0100)
commitcab9ef57755a8f7065b651cf16dce6d8f23ce5f3
tree4cb9af0de3b5b9b6d8b9e90d8171cabc1071b1f7
parent8c7d2f7a70c47d563494b07db00668c0cd5c7645
arm64: consistently use bl for C exception entry

In most cases, our exception entry assembly branches to C handlers with
a BL instruction, but in cases where we do not expect to return, we use
B instead.

While this is correct today, it means that backtraces for fatal
exceptions miss the entry assembly (as the LR is stale at the point we
call C code), while non-fatal exceptions have the entry assembly in the
LR. In subsequent patches, we will need the LR to be set in these cases
in order to backtrace reliably.

This patch updates these sites to use a BL, ensuring consistency, and
preparing for backtrace rework. An ASM_BUG() is added after each of
these new BLs, which both catches unexpected returns, and ensures that
the LR value doesn't point to another function label.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/entry.S