From 726f3e2403f0cd30a5c5fc7bdb84ac6c1e18cbc2 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 14 Mar 2018 11:05:38 +0100 Subject: ARM: aarch64: print more information on sync exception On a sync exception more useful information can be printed than we currently do. Pass the ESR and FAR value to do_sync and print the reason for the exception along with the address that actually faulted. Signed-off-by: Sascha Hauer --- arch/arm/cpu/exceptions_64.S | 4 ++++ arch/arm/cpu/interrupts_64.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/arm/cpu/exceptions_64.S b/arch/arm/cpu/exceptions_64.S index 58ca50b709..22034eaef9 100644 --- a/arch/arm/cpu/exceptions_64.S +++ b/arch/arm/cpu/exceptions_64.S @@ -35,12 +35,15 @@ switch_el x11, 3f, 2f, 1f 3: mrs x1, esr_el3 mrs x2, elr_el3 + mrs x3, far_el3 b 0f 2: mrs x1, esr_el2 mrs x2, elr_el2 + mrs x3, far_el2 b 0f 1: mrs x1, esr_el1 mrs x2, elr_el1 + mrs x3, far_el1 0: stp x2, x0, [sp, #-16]! mov x0, sp @@ -99,6 +102,7 @@ _do_bad_error: _do_sync: exception_entry + mov x2, x3 bl do_sync b exception_exit diff --git a/arch/arm/cpu/interrupts_64.c b/arch/arm/cpu/interrupts_64.c index c32cd4f051..ee3dc3380b 100644 --- a/arch/arm/cpu/interrupts_64.c +++ b/arch/arm/cpu/interrupts_64.c @@ -143,9 +143,9 @@ void do_bad_error(struct pt_regs *pt_regs) do_exception(pt_regs); } -void do_sync(struct pt_regs *pt_regs) +void do_sync(struct pt_regs *pt_regs, unsigned int esr, unsigned long far) { - printf("sync exception\n"); + printf("%s exception at 0x%016lx\n", esr_get_class_string(esr), far); do_exception(pt_regs); } -- cgit v1.2.3