diff options
author | Sandrine Bailleux <sandrine.bailleux@arm.com> | 2019-01-14 13:49:22 +0100 |
---|---|---|
committer | Sandrine Bailleux <sandrine.bailleux@arm.com> | 2019-01-14 13:51:17 +0100 |
commit | 452f360545f0b4d19720c2dfbaf80cf48c1aa3de (patch) | |
tree | e0a61d5a614b9f7193a0b53357f346e7ec8f04c3 | |
parent | 80ddcc3286b61f40015b30296a47baf47c3e8fd0 (diff) | |
download | tf-a-tests-452f360545f0b4d19720c2dfbaf80cf48c1aa3de.tar.gz |
Add CFI debug info to vector entries
This is based on TF-A commit 31823b6961d35a5d53e81d3bf4977ad7b2be81dd.
Add Call Frame Information assembler directives to vector entries so
that debuggers display the backtrace of functions that triggered a
synchronous exception. For example, a function triggering a data abort
will be easier to debug if the backtrace can be displayed from a
breakpoint at the beginning of the synchronous exception vector.
DS-5 needs CFI otherwise it will not attempt to display the backtrace.
Other debuggers might have other needs. These debug information are
stored in the ELF file but not in the final binary.
Change-Id: I1129419f318465049f53b5e41c304ea61fa44483
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
-rw-r--r-- | include/common/aarch64/asm_macros.S | 17 | ||||
-rw-r--r-- | lib/aarch64/exception_stubs.S | 1 | ||||
-rw-r--r-- | tftf/framework/aarch64/exceptions.S | 32 |
3 files changed, 26 insertions, 24 deletions
diff --git a/include/common/aarch64/asm_macros.S b/include/common/aarch64/asm_macros.S index ad4729018..5298ae0cd 100644 --- a/include/common/aarch64/asm_macros.S +++ b/include/common/aarch64/asm_macros.S @@ -61,20 +61,21 @@ */ .macro vector_entry label .section .vectors, "ax" + .cfi_sections .debug_frame .align 7, 0 + .type \label, %function + .cfi_startproc \label: .endm /* - * This macro verifies that the a given vector doesn't exceed the - * architectural limit of 32 instructions. This is meant to be placed - * immedately after the last instruction in the vector. It takes the - * vector entry as the parameter + * Add the bytes until fill the full exception vector, whose size is always + * 32 instructions. If there are more than 32 instructions in the + * exception vector then an error is emitted. */ - .macro check_vector_size since - .if (. - \since) > (32 * 4) - .error "Vector exceeds 32 instructions" - .endif + .macro end_vector_entry label + .cfi_endproc + .fill \label + (32 * 4) - . .endm /* diff --git a/lib/aarch64/exception_stubs.S b/lib/aarch64/exception_stubs.S index ba3192770..d418451ae 100644 --- a/lib/aarch64/exception_stubs.S +++ b/lib/aarch64/exception_stubs.S @@ -15,6 +15,7 @@ .macro vector_entry_spin name vector_entry \name b \name + end_vector_entry \name .endm vector_base exception_stubs diff --git a/tftf/framework/aarch64/exceptions.S b/tftf/framework/aarch64/exceptions.S index b1c664a46..41be653a4 100644 --- a/tftf/framework/aarch64/exceptions.S +++ b/tftf/framework/aarch64/exceptions.S @@ -15,26 +15,26 @@ vector_base tftf_vector */ vector_entry SynchronousExceptionSP0 b SynchronousExceptionSP0 - check_vector_size SynchronousExceptionSP0 +end_vector_entry SynchronousExceptionSP0 vector_entry IrqSP0 b IrqSP0 - check_vector_size IrqSP0 +end_vector_entry IrqSP0 vector_entry FiqSP0 b FiqSP0 - check_vector_size FiqSP0 +end_vector_entry FiqSP0 vector_entry SErrorSP0 b SErrorSP0 - check_vector_size SErrorSP0 +end_vector_entry SErrorSP0 /* * Current EL with SPx : 0x200 - 0x400. */ vector_entry SynchronousExceptionSPx b SynchronousExceptionSPx - check_vector_size SynchronousExceptionSPx +end_vector_entry SynchronousExceptionSPx vector_entry IrqSPx /* @@ -47,53 +47,53 @@ vector_entry IrqSPx bl restore_regs ldp x29, x30, [sp], #0x10 eret - check_vector_size IrqSPx +end_vector_entry IrqSPx vector_entry FiqSPx b FiqSPx - check_vector_size FiqSPx +end_vector_entry FiqSPx vector_entry SErrorSPx b SErrorSPx - check_vector_size SErrorSPx +end_vector_entry SErrorSPx /* * Lower EL using AArch64 : 0x400 - 0x600. */ vector_entry SynchronousExceptionA64 b SynchronousExceptionA64 - check_vector_size SynchronousExceptionA64 +end_vector_entry SynchronousExceptionA64 vector_entry IrqA64 b IrqA64 - check_vector_size IrqA64 +end_vector_entry IrqA64 vector_entry FiqA64 b FiqA64 - check_vector_size FiqA64 +end_vector_entry FiqA64 vector_entry SErrorA64 b SErrorA64 - check_vector_size SErrorA64 +end_vector_entry SErrorA64 /* * Lower EL using AArch32 : 0x600 - 0x800. */ vector_entry SynchronousExceptionA32 b SynchronousExceptionA32 - check_vector_size SynchronousExceptionA32 +end_vector_entry SynchronousExceptionA32 vector_entry IrqA32 b IrqA32 - check_vector_size IrqA32 +end_vector_entry IrqA32 vector_entry FiqA32 b FiqA32 - check_vector_size FiqA32 +end_vector_entry FiqA32 vector_entry SErrorA32 b SErrorA32 - check_vector_size SErrorA32 +end_vector_entry SErrorA32 // Note: Exceptions will always be from the same EL, so no need to save spsr |