PERFORCE change 29445 for review

Peter Wemm peter at FreeBSD.org
Tue Apr 22 14:05:03 PDT 2003


http://perforce.freebsd.org/chv.cgi?CH=29445

Change 29445 by peter at peter_overcee on 2003/04/22 14:04:50

	cpu_switch_load_gs isn't here.

Affected files ...

.. //depot/projects/hammer/sys/x86_64/include/md_var.h#15 edit
.. //depot/projects/hammer/sys/x86_64/x86_64/swtch.s#18 edit
.. //depot/projects/hammer/sys/x86_64/x86_64/trap.c#25 edit

Differences ...

==== //depot/projects/hammer/sys/x86_64/include/md_var.h#15 (text+ko) ====

@@ -62,7 +62,6 @@
 void	cpu_halt(void);
 void	cpu_reset(void);
 void	cpu_setregs(void);
-void	cpu_switch_load_gs(void) __asm(__STRING(cpu_switch_load_gs));
 void	doreti_iret(void) __asm(__STRING(doreti_iret));
 void	doreti_iret_fault(void) __asm(__STRING(doreti_iret_fault));
 void	doreti_popl_ds(void) __asm(__STRING(doreti_popl_ds));

==== //depot/projects/hammer/sys/x86_64/x86_64/swtch.s#18 (text+ko) ====

@@ -168,9 +168,6 @@
 	movq	%rdx, PCPU(CURPCB)
 	movq	%rsi, PCPU(CURTHREAD)		/* into next thread */
 
-	.globl	cpu_switch_load_gs
-cpu_switch_load_gs:
-
 	ret
 
 #ifdef INVARIANTS

==== //depot/projects/hammer/sys/x86_64/x86_64/trap.c#25 (text+ko) ====

@@ -198,8 +198,7 @@
 			 * 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();
 		}
 	}
@@ -353,28 +352,6 @@
 
 		case T_PROTFLT:		/* general protection fault */
 		case T_SEGNPFLT:	/* segment not present fault */
-			/*
-			 * Invalid %fs's and %gs's can be created using
-			 * procfs or PT_SETREGS or by invalidating the
-			 * underlying LDT entry.  This causes a fault
-			 * in kernel mode when the kernel attempts to
-			 * switch contexts.  Lose the bad context
-			 * (XXX) so that we can continue, and generate
-			 * a signal.
-			 */
-			if (frame.tf_rip == (long)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;
-			}
-
 			if (td->td_intr_nesting_level != 0)
 				break;
 


More information about the p4-projects mailing list