Module Name: src Committed By: maya Date: Mon Oct 9 17:49:28 UTC 2017
Modified Files: src/sys/arch/i386/i386: machdep.c src/sys/arch/x86/include: cpu.h src/sys/arch/x86/x86: fpu.c identcpu.c procfs_machdep.c x86_machdep.c Log Message: GC i386_fpu_present. no FPU x86 is not supported. Also delete newly unused send_sigill To generate a diff of this commit: cvs rdiff -u -r1.795 -r1.796 src/sys/arch/i386/i386/machdep.c cvs rdiff -u -r1.79 -r1.80 src/sys/arch/x86/include/cpu.h cvs rdiff -u -r1.13 -r1.14 src/sys/arch/x86/x86/fpu.c cvs rdiff -u -r1.59 -r1.60 src/sys/arch/x86/x86/identcpu.c cvs rdiff -u -r1.18 -r1.19 src/sys/arch/x86/x86/procfs_machdep.c cvs rdiff -u -r1.97 -r1.98 src/sys/arch/x86/x86/x86_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/i386/i386/machdep.c diff -u src/sys/arch/i386/i386/machdep.c:1.795 src/sys/arch/i386/i386/machdep.c:1.796 --- src/sys/arch/i386/i386/machdep.c:1.795 Sat Sep 30 11:43:57 2017 +++ src/sys/arch/i386/i386/machdep.c Mon Oct 9 17:49:27 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.795 2017/09/30 11:43:57 maxv Exp $ */ +/* $NetBSD: machdep.c,v 1.796 2017/10/09 17:49:27 maya Exp $ */ /* * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009, 2017 @@ -67,7 +67,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.795 2017/09/30 11:43:57 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.796 2017/10/09 17:49:27 maya Exp $"); #include "opt_beep.h" #include "opt_compat_freebsd.h" @@ -212,7 +212,6 @@ struct mtrr_funcs *mtrr_funcs; int cpu_class; int use_pae; -int i386_fpu_present = 1; int i386_fpu_fdivbug; int i386_use_fxsave; Index: src/sys/arch/x86/include/cpu.h diff -u src/sys/arch/x86/include/cpu.h:1.79 src/sys/arch/x86/include/cpu.h:1.80 --- src/sys/arch/x86/include/cpu.h:1.79 Sat Sep 16 09:28:38 2017 +++ src/sys/arch/x86/include/cpu.h Mon Oct 9 17:49:27 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.79 2017/09/16 09:28:38 maxv Exp $ */ +/* $NetBSD: cpu.h,v 1.80 2017/10/09 17:49:27 maya Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -381,14 +381,12 @@ extern char cpu_brand_string[]; extern int use_pae; #ifdef __i386__ -extern int i386_fpu_present; int npx586bug1(int, int); extern int i386_fpu_fdivbug; extern int i386_use_fxsave; extern int i386_has_sse; extern int i386_has_sse2; #else -#define i386_fpu_present 1 #define i386_fpu_fdivbug 0 #define i386_use_fxsave 1 #define i386_has_sse 1 Index: src/sys/arch/x86/x86/fpu.c diff -u src/sys/arch/x86/x86/fpu.c:1.13 src/sys/arch/x86/x86/fpu.c:1.14 --- src/sys/arch/x86/x86/fpu.c:1.13 Sun Sep 17 09:41:35 2017 +++ src/sys/arch/x86/x86/fpu.c Mon Oct 9 17:49:28 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: fpu.c,v 1.13 2017/09/17 09:41:35 maxv Exp $ */ +/* $NetBSD: fpu.c,v 1.14 2017/10/09 17:49:28 maya Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. All @@ -96,7 +96,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.13 2017/09/17 09:41:35 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.14 2017/10/09 17:49:28 maya Exp $"); #include "opt_multiprocessor.h" @@ -219,28 +219,12 @@ static const uint8_t fpetable[128] = { void fpuinit(struct cpu_info *ci) { - if (!i386_fpu_present) - return; clts(); fninit(); stts(); } -static void -send_sigill(void *rip) -{ - /* No fpu (486SX) - send SIGILL */ - ksiginfo_t ksi; - - x86_enable_intr(); - KSI_INIT_TRAP(&ksi); - ksi.ksi_signo = SIGILL; - ksi.ksi_addr = rip; - (*curlwp->l_proc->p_emul->e_trapsignal)(curlwp, &ksi); - return; -} - /* * This is a synchronous trap on either an x87 instruction (due to an * unmasked error on the previous x87 instruction) or on an SSE/SSE2 etc @@ -276,11 +260,6 @@ fputrap(struct trapframe *frame) if (!USERMODE(frame->tf_cs)) panic("fpu trap from kernel, trapframe %p\n", frame); - if (i386_fpu_present == 0) { - send_sigill((void *)X86_TF_RIP(frame)); - return; - } - /* * At this point, fpcurlwp should be curlwp. If it wasn't, the TS bit * should be set, and we should have gotten a DNA exception. @@ -343,11 +322,6 @@ fpudna(struct trapframe *frame) panic("fpudna from kernel, ip %p, trapframe %p\n", (void *)X86_TF_RIP(frame), frame); - if (i386_fpu_present == 0) { - send_sigill((void *)X86_TF_RIP(frame)); - return; - } - ci = curcpu(); /* Save soft spl level - interrupts are hard disabled */ Index: src/sys/arch/x86/x86/identcpu.c diff -u src/sys/arch/x86/x86/identcpu.c:1.59 src/sys/arch/x86/x86/identcpu.c:1.60 --- src/sys/arch/x86/x86/identcpu.c:1.59 Mon Oct 9 17:41:18 2017 +++ src/sys/arch/x86/x86/identcpu.c Mon Oct 9 17:49:28 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: identcpu.c,v 1.59 2017/10/09 17:41:18 maya Exp $ */ +/* $NetBSD: identcpu.c,v 1.60 2017/10/09 17:49:28 maya Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.59 2017/10/09 17:41:18 maya Exp $"); +__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.60 2017/10/09 17:49:28 maya Exp $"); #include "opt_xen.h" @@ -971,9 +971,6 @@ cpu_identify(struct cpu_info *ci) #endif #ifdef i386 - if (i386_fpu_present == 0) - aprint_normal_dev(ci->ci_dev, "no fpu\n"); - if (i386_fpu_fdivbug == 1) aprint_normal_dev(ci->ci_dev, "WARNING: Pentium FDIV bug detected!\n"); Index: src/sys/arch/x86/x86/procfs_machdep.c diff -u src/sys/arch/x86/x86/procfs_machdep.c:1.18 src/sys/arch/x86/x86/procfs_machdep.c:1.19 --- src/sys/arch/x86/x86/procfs_machdep.c:1.18 Thu Oct 5 03:24:40 2017 +++ src/sys/arch/x86/x86/procfs_machdep.c Mon Oct 9 17:49:28 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: procfs_machdep.c,v 1.18 2017/10/05 03:24:40 msaitoh Exp $ */ +/* $NetBSD: procfs_machdep.c,v 1.19 2017/10/09 17:49:28 maya Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.18 2017/10/05 03:24:40 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.19 2017/10/09 17:49:28 maya Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -420,7 +420,7 @@ procfs_getonecpu(int xcpu, struct cpu_in #ifdef __i386__ "fdiv_bug\t: %s\n" #endif - "fpu\t\t: %s\n" + "fpu\t\t: yes\n" "fpu_exception\t: yes\n" "cpuid level\t: %d\n" "wp\t\t: %s\n" @@ -429,7 +429,6 @@ procfs_getonecpu(int xcpu, struct cpu_in #ifdef __i386__ i386_fpu_fdivbug ? "yes" : "no", /* an old pentium */ #endif - i386_fpu_present ? "yes" : "no", /* not a 486SX */ ci->ci_max_cpuid, (rcr0() & CR0_WP) ? "yes" : "no", featurebuf, Index: src/sys/arch/x86/x86/x86_machdep.c diff -u src/sys/arch/x86/x86/x86_machdep.c:1.97 src/sys/arch/x86/x86/x86_machdep.c:1.98 --- src/sys/arch/x86/x86/x86_machdep.c:1.97 Sun Oct 8 09:06:50 2017 +++ src/sys/arch/x86/x86/x86_machdep.c Mon Oct 9 17:49:28 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: x86_machdep.c,v 1.97 2017/10/08 09:06:50 maxv Exp $ */ +/* $NetBSD: x86_machdep.c,v 1.98 2017/10/09 17:49:28 maya Exp $ */ /*- * Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi, @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.97 2017/10/08 09:06:50 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.98 2017/10/09 17:49:28 maya Exp $"); #include "opt_modular.h" #include "opt_physmem.h" @@ -1233,8 +1233,6 @@ SYSCTL_SETUP(sysctl_machdep_setup, "sysc #endif /* None of these can ever change once the system has booted */ - const_sysctl(clog, "fpu_present", CTLTYPE_INT, i386_fpu_present, - CPU_FPU_PRESENT); const_sysctl(clog, "osfxsr", CTLTYPE_INT, i386_use_fxsave, CPU_OSFXSR); const_sysctl(clog, "sse", CTLTYPE_INT, i386_has_sse,