Index: head/sys/arm64/arm64/trap.c =================================================================== --- head/sys/arm64/arm64/trap.c +++ head/sys/arm64/arm64/trap.c @@ -87,6 +87,7 @@ typedef void (abort_handler)(struct thread *, struct trapframe *, uint64_t, uint64_t, int); +static abort_handler align_abort; static abort_handler data_abort; static abort_handler *abort_handlers[] = { @@ -100,6 +101,7 @@ [ISS_DATA_DFSC_PF_L1] = data_abort, [ISS_DATA_DFSC_PF_L2] = data_abort, [ISS_DATA_DFSC_PF_L3] = data_abort, + [ISS_DATA_DFSC_ALIGN] = align_abort, }; static __inline void @@ -163,6 +165,17 @@ call_trapsignal(td, SIGILL, ILL_ILLOPN, (void *)frame->tf_elr); userret(td, frame); } +} + +static void +align_abort(struct thread *td, struct trapframe *frame, uint64_t esr, + uint64_t far, int lower) +{ + if (!lower) + panic("Misaligned access from kernel space!"); + + call_trapsignal(td, SIGBUS, BUS_ADRALN, (void *)frame->tf_elr); + userret(td, frame); } static void