diff options
author | kmacy <kmacy@FreeBSD.org> | 2006-12-16 02:40:19 +0000 |
---|---|---|
committer | kmacy <kmacy@FreeBSD.org> | 2006-12-16 02:40:19 +0000 |
commit | 277c74ca2bc24c774db5be5c34e04dc05fdccac6 (patch) | |
tree | 1473fb923c8141644961b09ea2cc283ec60c10d0 /sys/sun4v | |
parent | ad3abace0cb8e4401b0dd5b68b63f1c8405baeef (diff) | |
download | FreeBSD-src-277c74ca2bc24c774db5be5c34e04dc05fdccac6.zip FreeBSD-src-277c74ca2bc24c774db5be5c34e04dc05fdccac6.tar.gz |
don't return directly to copyin and friends when we hit certain types of faults
this fixes the unkillable syscall in stress2
Diffstat (limited to 'sys/sun4v')
-rw-r--r-- | sys/sun4v/sun4v/trap.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/sys/sun4v/sun4v/trap.c b/sys/sun4v/sun4v/trap.c index be7f20b..c8a5f38 100644 --- a/sys/sun4v/sun4v/trap.c +++ b/sys/sun4v/sun4v/trap.c @@ -239,7 +239,6 @@ SYSCTL_INT(_debug, OID_AUTO, debugger_on_signal, CTLFLAG_RW, &debugger_on_signal, 0, ""); #endif - void trap_init(void) { @@ -320,6 +319,21 @@ trap(struct trapframe *tf, int64_t type, uint64_t data) case T_MEM_ADDRESS_NOT_ALIGNED: printf("bad trap trapno=%ld data=0x%lx pc=0x%lx\n", trapno, data, tf->tf_tpc); + if (tf->tf_tpc >= (u_long)copy_nofault_begin && + tf->tf_tpc <= (u_long)copy_nofault_end) { + tf->tf_tpc = (u_long)copy_fault; + tf->tf_tnpc = tf->tf_tpc + 4; + sig = 0; + break; + } + if (tf->tf_tpc >= (u_long)fs_nofault_begin && + tf->tf_tpc <= (u_long)fs_nofault_end) { + tf->tf_tpc = (u_long)fs_fault; + tf->tf_tnpc = tf->tf_tpc + 4; + sig = 0; + break; + } + addr = data; sig = trap_sig[trapno]; break; @@ -343,8 +357,8 @@ trap(struct trapframe *tf, int64_t type, uint64_t data) kdb_enter("trapsig"); #ifdef VERBOSE if (sig == 4 || sig == 10 || sig == 11) - printf("trap: %ld:%s: 0x%lx at 0x%lx on cpu=%d sig=%d\n", trapno, - trap_msg[trapno], data, tf->tf_tpc, curcpu, sig); + printf("trap: %ld:%s: 0x%lx at 0x%lx on cpu=%d sig=%d proc=%s\n", + trapno, trap_msg[trapno], data, tf->tf_tpc, curcpu, sig, curthread->td_proc->p_comm); #endif /* XXX I've renumbered the traps to largely reflect what the hardware uses * so this will need to be re-visited |