From 9f10c9cf60e8a2781075dcd25061d8a072b05366 Mon Sep 17 00:00:00 2001 From: kettenis Date: Sat, 29 Apr 2017 17:10:43 +0000 Subject: [PATCH] Move the userret() call out of data_abort() and simply call it just before we return from do_el0_sync(). Prevents future mistakes. --- sys/arch/arm64/arm64/trap.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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 -- 2.20.1