diff options
author | davidxu <davidxu@FreeBSD.org> | 2003-04-24 01:48:59 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2003-04-24 01:48:59 +0000 |
commit | 7dbf40d20d37617abb4126fde75722424d47ce50 (patch) | |
tree | 2148818b1d7e4c098e464487fa619b8010b7f6f5 /sys | |
parent | e17d2e5a6fa55215d82883890ef39b881717b5bd (diff) | |
download | FreeBSD-src-7dbf40d20d37617abb4126fde75722424d47ce50.zip FreeBSD-src-7dbf40d20d37617abb4126fde75722424d47ce50.tar.gz |
Don't print anything for fault at cpu_switch_load_gs, just like other
code to recover fault in doreti because of invalid segment registers,
silently push error to userland.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/amd64/trap.c | 9 | ||||
-rw-r--r-- | sys/i386/i386/trap.c | 9 |
2 files changed, 6 insertions, 12 deletions
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index a0f8508..032702c 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -212,7 +212,8 @@ trap(frame) printf( "pid %ld (%s): trap %d with interrupts disabled\n", (long)curproc->p_pid, curproc->p_comm, type); - else if (type != T_BPTFLT && type != T_TRCTRAP) { + else if (type != T_BPTFLT && type != T_TRCTRAP && + frame.tf_eip != (int)cpu_switch_load_gs) { /* * XXX not quite right, since this may be for a * multiple fault in user mode. @@ -224,8 +225,7 @@ trap(frame) * and we shouldn't enable interrupts while holding a * spin lock. */ - if (type != T_PAGEFLT && PCPU_GET(spinlocks) == NULL && - frame.tf_eip != (int)cpu_switch_load_gs) + if (type != T_PAGEFLT && PCPU_GET(spinlocks) == NULL) enable_intr(); } } @@ -481,9 +481,6 @@ trap(frame) */ if (frame.tf_eip == (int)cpu_switch_load_gs) { PCPU_GET(curpcb)->pcb_gs = 0; - printf( - "Process %d has bad %%gs, reset to zero\n", - p->p_pid); #if 0 PROC_LOCK(p); psignal(p, SIGBUS); diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index a0f8508..032702c 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -212,7 +212,8 @@ trap(frame) printf( "pid %ld (%s): trap %d with interrupts disabled\n", (long)curproc->p_pid, curproc->p_comm, type); - else if (type != T_BPTFLT && type != T_TRCTRAP) { + else if (type != T_BPTFLT && type != T_TRCTRAP && + frame.tf_eip != (int)cpu_switch_load_gs) { /* * XXX not quite right, since this may be for a * multiple fault in user mode. @@ -224,8 +225,7 @@ trap(frame) * and we shouldn't enable interrupts while holding a * spin lock. */ - if (type != T_PAGEFLT && PCPU_GET(spinlocks) == NULL && - frame.tf_eip != (int)cpu_switch_load_gs) + if (type != T_PAGEFLT && PCPU_GET(spinlocks) == NULL) enable_intr(); } } @@ -481,9 +481,6 @@ trap(frame) */ if (frame.tf_eip == (int)cpu_switch_load_gs) { PCPU_GET(curpcb)->pcb_gs = 0; - printf( - "Process %d has bad %%gs, reset to zero\n", - p->p_pid); #if 0 PROC_LOCK(p); psignal(p, SIGBUS); |