From: kettenis Date: Sat, 29 Apr 2017 17:10:43 +0000 (+0000) Subject: Move the userret() call out of data_abort() and simply call it just before we X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9f10c9cf60e8a2781075dcd25061d8a072b05366;p=openbsd Move the userret() call out of data_abort() and simply call it just before we return from do_el0_sync(). Prevents future mistakes. --- diff --git a/sys/arch/arm64/arm64/trap.c b/sys/arch/arm64/arm64/trap.c index ccc9ff8a3bd..cec2e0ba5b0 100644 --- a/sys/arch/arm64/arm64/trap.c +++ b/sys/arch/arm64/arm64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.6 2017/04/24 08:09:13 kettenis Exp $ */ +/* $OpenBSD: trap.c,v 1.7 2017/04/29 17:10:43 kettenis Exp $ */ /*- * Copyright (c) 2014 Andrew Turner * All rights reserved. @@ -208,9 +208,6 @@ data_abort(struct trapframe *frame, uint64_t esr, int lower, int exe) panic("uvm_fault failed: %lx", frame->tf_elr); } } - - if (lower) - userret(p); } void @@ -305,7 +302,6 @@ do_el0_sync(struct trapframe *frame) vfp_save(); sv.sival_ptr = (void *)frame->tf_elr; trapsignal(p, SIGTRAP, 0, TRAP_BRKPT, sv); - userret(p); break; default: // panic("Unknown userland exception %x esr_el1 %lx\n", exception, @@ -317,8 +313,9 @@ do_el0_sync(struct trapframe *frame) dumpregs(frame); } sigexit(p, SIGILL); - userret(p); } + + userret(p); } void