summaryrefslogtreecommitdiffstats
path: root/sys/pc98/i386/trap.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/pc98/i386/trap.c')
-rw-r--r--sys/pc98/i386/trap.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/sys/pc98/i386/trap.c b/sys/pc98/i386/trap.c
index 2b06769..fb9431f 100644
--- a/sys/pc98/i386/trap.c
+++ b/sys/pc98/i386/trap.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)trap.c 7.4 (Berkeley) 5/13/91
- * $Id: trap.c,v 1.38 1997/11/07 12:53:49 kato Exp $
+ * $Id: trap.c,v 1.39 1997/11/25 09:53:44 kato Exp $
*/
/*
@@ -146,6 +146,11 @@ static char *trap_msg[] = {
static void userret __P((struct proc *p, struct trapframe *frame,
u_quad_t oticks));
+#ifndef NO_F00F_HACK
+extern struct gate_descriptor *t_idt;
+extern int has_f00f_bug;
+#endif
+
static inline void
userret(p, frame, oticks)
struct proc *p;
@@ -218,6 +223,9 @@ trap(frame)
vm_offset_t va;
#endif
+#ifndef NO_F00F_HACK
+restart:
+#endif
type = frame.tf_trapno;
code = frame.tf_err;
@@ -300,6 +308,10 @@ trap(frame)
#endif
if (i == -1)
return;
+#ifndef NO_F00F_HACK
+ if (i == -2)
+ goto restart;
+#endif
if (i == 0)
goto out;
@@ -692,7 +704,18 @@ trap_pfault(frame, usermode)
if (va >= KERNBASE) {
/*
* Don't allow user-mode faults in kernel address space.
+ * An exception: if the faulting address is the invalid
+ * instruction entry in the IDT, then the Intel Pentium
+ * F00F bug workaround was triggered, and we need to
+ * treat it is as an illegal instruction, and not a page
+ * fault.
*/
+#ifndef NO_F00F_HACK
+ if ((eva == (unsigned int)&t_idt[6]) && has_f00f_bug) {
+ frame->tf_trapno = T_PRIVINFLT;
+ return -2;
+ }
+#endif
if (usermode)
goto nogo;
OpenPOWER on IntegriCloud