diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2003-04-07 17:09:43 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2003-04-07 17:09:43 +0000 |
commit | ecde4cc0419849342dddd2426014fd7789a7496d (patch) | |
tree | 2b08e11e62a355b97c5ec1c437f13e317b9325ab /sys | |
parent | 1f00a7820bb9388fc760142da5c787e1af9d9628 (diff) |
only check for space mismatch when coming from user.
the only case of user refering the kernel space is for the
syscall and that never faults since always mapped.
this fixes some random sig11 occurences.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/hppa/hppa/trap.c | 42 |
1 files changed, 9 insertions, 33 deletions
diff --git a/sys/arch/hppa/hppa/trap.c b/sys/arch/hppa/hppa/trap.c index 947ef13b150..5f5351af7bb 100644 --- a/sys/arch/hppa/hppa/trap.c +++ b/sys/arch/hppa/hppa/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.62 2003/02/25 14:04:09 miod Exp $ */ +/* $OpenBSD: trap.c,v 1.63 2003/04/07 17:09:42 mickey Exp $ */ /* * Copyright (c) 1998-2003 Michael Shalayeff @@ -355,47 +355,23 @@ trap(type, frame) break; } - if (!(vm = p->p_vmspace)) { - printf("trap: no vm, p=%p\n", p); - goto dead_end; - } - /* * it could be a kernel map for exec_map faults */ - if (!(type & T_USER) && space == HPPA_SID_KERNEL) + if (space == HPPA_SID_KERNEL) map = kernel_map; - else + else { + vm = p->p_vmspace; map = &vm->vm_map; - - if (map->pmap->pm_space != space) { - if (map->pmap->pm_space != HPPA_SID_KERNEL) { - sv.sival_int = va; - trapsignal(p, SIGSEGV, vftype, SEGV_MAPERR, sv); - } else { - printf("trap: space missmatch %d != %d\n", - space, map->pmap->pm_space); - goto dead_end; - } - } - -#ifdef TRAPDEBUG - if (space == -1) { - extern int pmapdebug; - pmapdebug = 0xffffff; } -#endif - ret = uvm_fault(map, hppa_trunc_page(va), fault, vftype); -#ifdef TRAPDEBUG - if (space == -1) { - extern int pmapdebug; - pmapdebug = 0; + if (type & T_USER && map->pmap->pm_space != space) { + sv.sival_int = va; + trapsignal(p, SIGSEGV, vftype, SEGV_MAPERR, sv); + break; } - printf("uvm_fault(%p, %x, %d, %d)=%d\n", - map, va, 0, vftype, ret); -#endif + ret = uvm_fault(map, hppa_trunc_page(va), fault, vftype); /* * If this was a stack access we keep track of the maximum |