Skip to contentSkip to conversation

arm64: Improve unhandled exception traces

PATCH In review Andrew Jones 2 participants 2 messages Feb 27, 2024 – Mar 18, 2024 KVM arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: Improve unhandled exception traces

Put the stack trace at the bottom, rather than mixing it with register dumps, and also start the trace from the current PC.

---
 lib/arm64/processor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/arm64/processor.c +1 -1
index 5bcad679605e..06fd7cfcc548 100644
@@ -130,9 +130,9 @@ static void bad_exception(enum vector v, struct pt_regs *regs,
 	printf("Vector: %d (%s)\n", v, vector_names[v]);
 	printf("ESR_EL1: %8s%08x, ec=%#x (%s)\n", "", esr, ec, ec_names[ec]);
 	printf("FAR_EL1: %016lx (%svalid)\n", far, far_valid ? "" : "not ");
-	dump_stack();
 	printf("Exception frame registers:\n");
 	show_regs(regs);
+	dump_frame_stack((void *)regs->pc, (void *)regs->regs[29]);
 	abort();
 }
 
Signature · 1 line
2.43.0
#1 lore raw
Quoted 26 lines · Andrew Jones

Put the stack trace at the bottom, rather than mixing it with register dumps, and also start the trace from the current PC.

---
 lib/arm64/processor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/arm64/processor.c +1 -1
index 5bcad679605e..06fd7cfcc548 100644
@@ -130,9 +130,9 @@ static void bad_exception(enum vector v, struct pt_regs *regs,
 	printf("Vector: %d (%s)\n", v, vector_names[v]);
 	printf("ESR_EL1: %8s%08x, ec=%#x (%s)\n", "", esr, ec, ec_names[ec]);
 	printf("FAR_EL1: %016lx (%svalid)\n", far, far_valid ? "" : "not ");
-	dump_stack();
 	printf("Exception frame registers:\n");
 	show_regs(regs);
+	dump_frame_stack((void *)regs->pc, (void *)regs->regs[29]);
 	abort();
 }
 
Signature · 1 line
2.43.0

Merged.

Thanks,
drew