summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2007-07-05 22:16:30 +0000
committerkettenis <kettenis@openbsd.org>2007-07-05 22:16:30 +0000
commit96ec353f937c77f921aa907b5a3a1a883551d74a (patch)
tree02a596c918544d1b80c0a0c43a42f542f3d1d740
parentfixes my previous commit. (diff)
downloadwireguard-openbsd-96ec353f937c77f921aa907b5a3a1a883551d74a.tar.xz
wireguard-openbsd-96ec353f937c77f921aa907b5a3a1a883551d74a.zip
Report actual faulting address (if we can) instead of the mmu tag word for
SIGSEGV. tested by jasper@
-rw-r--r--sys/arch/sparc64/sparc64/trap.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/arch/sparc64/sparc64/trap.c b/sys/arch/sparc64/sparc64/trap.c
index bb37a8135e5..388896d733d 100644
--- a/sys/arch/sparc64/sparc64/trap.c
+++ b/sys/arch/sparc64/sparc64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.50 2007/05/14 21:38:08 kettenis Exp $ */
+/* $OpenBSD: trap.c,v 1.51 2007/07/05 22:16:30 kettenis Exp $ */
/* $NetBSD: trap.c,v 1.73 2001/08/09 01:03:01 eeh Exp $ */
/*
@@ -809,8 +809,6 @@ data_access_fault(tf, type, pc, addr, sfva, sfsr)
vaddr_t onfault;
union sigval sv;
- sv.sival_ptr = (void *)addr;
-
uvmexp.traps++;
if ((p = curproc) == NULL) /* safety check */
p = &proc0;
@@ -904,6 +902,12 @@ kfault:
tf->tf_npc = onfault + 4;
return;
}
+
+ if (type == T_FDMMU_MISS || (sfsr & SFSR_FV) == 0)
+ sv.sival_ptr = (void *)va;
+ else
+ sv.sival_ptr = (void *)sfva;
+
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %u killed: out of swap\n",
p->p_pid, p->p_comm,