Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Sep 2002 20:32:21 -0700 (PDT)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 17820 for review
Message-ID:  <200209210332.g8L3WLQe009125@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=17820

Change 17820 by peter@peter_daintree on 2002/09/20 20:31:29

	unifdef -U I586_CPU (and f00f_hack stuff)

Affected files ...

.. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#9 edit
.. //depot/projects/hammer/sys/x86_64/x86_64/trap.c#6 edit

Differences ...

==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#9 (text+ko) ====

@@ -672,10 +672,6 @@
 
 int private_tss;			/* flag indicating private tss */
 
-#if defined(I586_CPU) && !defined(NO_F00F_HACK)
-extern int has_f00f_bug;
-#endif
-
 static struct i386tss dblfault_tss;
 static char dblfault_stack[PAGE_SIZE];
 
@@ -1453,45 +1449,6 @@
 {
 }
 
-#if defined(I586_CPU) && !defined(NO_F00F_HACK)
-static void f00f_hack(void *unused);
-SYSINIT(f00f_hack, SI_SUB_INTRINSIC, SI_ORDER_FIRST, f00f_hack, NULL);
-
-static void
-f00f_hack(void *unused) {
-	struct gate_descriptor *new_idt;
-#ifndef SMP
-	struct region_descriptor r_idt;
-#endif
-	vm_offset_t tmp;
-
-	if (!has_f00f_bug)
-		return;
-
-	GIANT_REQUIRED;
-
-	printf("Intel Pentium detected, installing workaround for F00F bug\n");
-
-	r_idt.rd_limit = sizeof(idt0) - 1;
-
-	tmp = kmem_alloc(kernel_map, PAGE_SIZE * 2);
-	if (tmp == 0)
-		panic("kmem_alloc returned 0");
-	if (((unsigned int)tmp & (PAGE_SIZE-1)) != 0)
-		panic("kmem_alloc returned non-page-aligned memory");
-	/* Put the first seven entries in the lower page */
-	new_idt = (struct gate_descriptor*)(tmp + PAGE_SIZE - (7*8));
-	bcopy(idt, new_idt, sizeof(idt0));
-	r_idt.rd_base = (int)new_idt;
-	lidt(&r_idt);
-	idt = new_idt;
-	if (vm_map_protect(kernel_map, tmp, tmp + PAGE_SIZE,
-			   VM_PROT_READ, FALSE) != KERN_SUCCESS)
-		panic("vm_map_protect failed");
-	return;
-}
-#endif /* defined(I586_CPU) && !NO_F00F_HACK */
-
 int
 ptrace_set_pc(struct thread *td, unsigned long addr)
 {

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

@@ -141,10 +141,6 @@
 	"machine check trap",			/* 28 T_MCHK */
 };
 
-#if defined(I586_CPU) && !defined(NO_F00F_HACK)
-extern int has_f00f_bug;
-#endif
-
 #ifdef DDB
 static int ddb_on_nmi = 1;
 SYSCTL_INT(_machdep, OID_AUTO, ddb_on_nmi, CTLFLAG_RW,
@@ -307,21 +303,6 @@
 
 		case T_PAGEFLT:		/* page fault */
 			i = trap_pfault(&frame, TRUE, eva);
-#if defined(I586_CPU) && !defined(NO_F00F_HACK)
-			if (i == -2) {
-				/*
-				 * The f00f hack workaround has triggered, so
-				 * treat the fault as an illegal instruction 
-				 * (T_PRIVINFLT) instead of a page fault.
-				 */
-				type = frame.tf_trapno = T_PRIVINFLT;
-
-				/* Proceed as in that case. */
-				ucode = type;
-				i = SIGILL;
-				break;
-			}
-#endif
 			if (i == -1)
 				goto userout;
 			if (i == 0)
@@ -637,10 +618,6 @@
 		 * treat it is as an illegal instruction, and not a page
 		 * fault.
 		 */
-#if defined(I586_CPU) && !defined(NO_F00F_HACK)
-		if ((eva == (unsigned int)&idt[6]) && has_f00f_bug)
-			return -2;
-#endif
 		if (usermode)
 			goto nogo;
 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200209210332.g8L3WLQe009125>