From: kettenis Date: Mon, 15 May 2023 15:02:06 +0000 (+0000) Subject: Pass the ESR as the trapno value; this might help in determining the detailed X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d810076c98bb27ffc3e3438a08b43e0a895a9dc3;p=openbsd Pass the ESR as the trapno value; this might help in determining the detailed cause of a signal. ok bluhm@, guenther@, deraadt@ --- diff --git a/sys/arch/arm64/arm64/trap.c b/sys/arch/arm64/arm64/trap.c index 78d1857f383..d7f0d84a9fd 100644 --- a/sys/arch/arm64/arm64/trap.c +++ b/sys/arch/arm64/arm64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.44 2023/04/26 12:30:24 kettenis Exp $ */ +/* $OpenBSD: trap.c,v 1.45 2023/05/15 15:02:06 kettenis Exp $ */ /*- * Copyright (c) 2014 Andrew Turner * All rights reserved. @@ -94,7 +94,7 @@ udata_abort(struct trapframe *frame, uint64_t esr, uint64_t far, int exe) switch (esr & ISS_DATA_DFSC_MASK) { case ISS_DATA_DFSC_ALIGN: sv.sival_ptr = (void *)far; - trapsignal(p, SIGBUS, 0, BUS_ADRALN, sv); + trapsignal(p, SIGBUS, esr, BUS_ADRALN, sv); return; default: break; @@ -132,7 +132,7 @@ udata_abort(struct trapframe *frame, uint64_t esr, uint64_t far, int exe) code = SEGV_MAPERR; } sv.sival_ptr = (void *)far; - trapsignal(p, sig, 0, code, sv); + trapsignal(p, sig, esr, code, sv); } static void @@ -275,7 +275,7 @@ do_el0_sync(struct trapframe *frame) case EXCP_UNKNOWN: curcpu()->ci_flush_bp(); sv.sival_ptr = (void *)frame->tf_elr; - trapsignal(p, SIGILL, 0, ILL_ILLOPC, sv); + trapsignal(p, SIGILL, esr, ILL_ILLOPC, sv); break; case EXCP_FP_SIMD: case EXCP_TRAP_FP: @@ -284,7 +284,7 @@ do_el0_sync(struct trapframe *frame) case EXCP_BRANCH_TGT: curcpu()->ci_flush_bp(); sv.sival_ptr = (void *)frame->tf_elr; - trapsignal(p, SIGILL, 0, ILL_ILLOPC, sv); + trapsignal(p, SIGILL, esr, ILL_ILLOPC, sv); break; case EXCP_SVC: svc_handler(frame); @@ -295,23 +295,23 @@ do_el0_sync(struct trapframe *frame) case EXCP_PC_ALIGN: curcpu()->ci_flush_bp(); sv.sival_ptr = (void *)frame->tf_elr; - trapsignal(p, SIGBUS, 0, BUS_ADRALN, sv); + trapsignal(p, SIGBUS, esr, BUS_ADRALN, sv); break; case EXCP_SP_ALIGN: curcpu()->ci_flush_bp(); sv.sival_ptr = (void *)frame->tf_sp; - trapsignal(p, SIGBUS, 0, BUS_ADRALN, sv); + trapsignal(p, SIGBUS, esr, BUS_ADRALN, sv); break; case EXCP_DATA_ABORT_L: udata_abort(frame, esr, far, 0); break; case EXCP_BRK: sv.sival_ptr = (void *)frame->tf_elr; - trapsignal(p, SIGTRAP, 0, TRAP_BRKPT, sv); + trapsignal(p, SIGTRAP, esr, TRAP_BRKPT, sv); break; case EXCP_SOFTSTP_EL0: sv.sival_ptr = (void *)frame->tf_elr; - trapsignal(p, SIGTRAP, 0, TRAP_TRACE, sv); + trapsignal(p, SIGTRAP, esr, TRAP_TRACE, sv); break; default: // panic("Unknown userland exception %x esr_el1 %lx", exception,