From owner-p4-projects Fri Sep 20 20:32:27 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D504337B406; Fri, 20 Sep 2002 20:32:22 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 82D5A37B401 for ; Fri, 20 Sep 2002 20:32:22 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id EE72743E42 for ; Fri, 20 Sep 2002 20:32:21 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from freefall.freebsd.org (perforce@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g8L3WLCo009128 for ; Fri, 20 Sep 2002 20:32:21 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g8L3WLQe009125 for perforce@freebsd.org; Fri, 20 Sep 2002 20:32:21 -0700 (PDT) Date: Fri, 20 Sep 2002 20:32:21 -0700 (PDT) Message-Id: <200209210332.g8L3WLQe009125@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm Subject: PERFORCE change 17820 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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