summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2003-04-22 07:45:47 +0000
committerdavidxu <davidxu@FreeBSD.org>2003-04-22 07:45:47 +0000
commitd0165cba28630a27f5237e7ac152e4b1988c71c3 (patch)
treec8abd560f751dcf39cfe666518bffcea66e722a4 /sys/i386
parentb78fdbef61b325753ad91919472a89494410ff60 (diff)
downloadFreeBSD-src-d0165cba28630a27f5237e7ac152e4b1988c71c3.zip
FreeBSD-src-d0165cba28630a27f5237e7ac152e4b1988c71c3.tar.gz
Fix some problems for cpu_switch_load_gs. when fault address is at
cpu_switch_load_gs, cpu is in context switch, so don't enable interrupt. because it is in context switch, it is expected sched_lock was held, so don't PROC_LOCK(p) and psignal, it is LOR, probably we can set a P_XSIGBUS like flag in p_sflags, and set TDF_ASTPENDING in td_flags, in ast(), post a SIGBUS to process if P_XSIGBUS was set.
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/trap.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c
index 4b4cb81..f8662b2 100644
--- a/sys/i386/i386/trap.c
+++ b/sys/i386/i386/trap.c
@@ -224,7 +224,8 @@ trap(frame)
* and we shouldn't enable interrupts while holding a
* spin lock.
*/
- if (type != T_PAGEFLT && PCPU_GET(spinlocks) == NULL)
+ if (type != T_PAGEFLT && PCPU_GET(spinlocks) == NULL &&
+ frame.tf_eip != (int)cpu_switch_load_gs)
enable_intr();
}
}
@@ -483,9 +484,14 @@ 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);
PROC_UNLOCK(p);
+#endif
goto out;
}
OpenPOWER on IntegriCloud