git: 317e97a59f26 - stable/13 - Print the instruction for the unknown exception

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Mon, 04 Apr 2022 11:05:57 UTC
The branch stable/13 has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=317e97a59f26ebe3f52c3db2925ca8175fe2d809

commit 317e97a59f26ebe3f52c3db2925ca8175fe2d809
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2022-03-08 11:02:02 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2022-04-04 09:37:05 +0000

    Print the instruction for the unknown exception
    
    The arm64 unknown exception will be raised when we execute an
    instruction that id invalid or disabled. To help debug these print
    the instruction that failed.
    
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit e793a55a74eb34ae3225d620a9619554667efb30)
---
 sys/arm64/arm64/trap.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c
index 849f26ee8220..75ae9e8fedac 100644
--- a/sys/arm64/arm64/trap.c
+++ b/sys/arm64/arm64/trap.c
@@ -492,6 +492,8 @@ do_el1h_sync(struct thread *td, struct trapframe *frame)
 	case EXCP_UNKNOWN:
 		if (undef_insn(1, frame))
 			break;
+		printf("Undefined instruction: %08x\n",
+		    *(uint32_t *)frame->tf_elr);
 		/* FALLTHROUGH */
 	default:
 		print_registers(frame);