From owner-freebsd-bugs Mon Jul 8 11:30:14 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4D99437B401 for ; Mon, 8 Jul 2002 11:30:06 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 51FEC43E3B for ; Mon, 8 Jul 2002 11:30:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g68IU3JU071349 for ; Mon, 8 Jul 2002 11:30:03 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g68IU3hn071348; Mon, 8 Jul 2002 11:30:03 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 97FCD37B400 for ; Mon, 8 Jul 2002 11:23:00 -0700 (PDT) Received: from Guest.Forest.Od.UA (Guest.Forest.Od.UA [195.138.73.220]) by mx1.FreeBSD.org (Postfix) with ESMTP id CCC5C43E31 for ; Mon, 8 Jul 2002 11:22:51 -0700 (PDT) (envelope-from root@rainbow.deep.forest.od.ua) Received: (from uucp@localhost) by Guest.Forest.Od.UA (8.11.3/8.11.3) with UUCP id g68DanY83652 for FreeBSD-gnats-submit@freebsd.org; Mon, 8 Jul 2002 16:36:49 +0300 (EEST) (envelope-from root@rainbow.deep.forest.od.ua) Received: from Rainbow.Deep.Forest (localhost.Deep.Forest [127.0.0.1]) by Rainbow.Deep.Forest (8.12.4/8.12.4) with ESMTP id g68IJK8a021204 for ; Mon, 8 Jul 2002 21:19:20 +0300 (EEST) (envelope-from root@rainbow.deep.forest) Received: (from root@localhost) by Rainbow.Deep.Forest (8.12.4/8.12.4/Submit) id g68IJKKD021203; Mon, 8 Jul 2002 21:19:20 +0300 (EEST) (envelope-from root) Message-Id: <200207081819.g68IJKKD021203@Rainbow.Deep.Forest> Date: Mon, 8 Jul 2002 21:19:20 +0300 (EEST) From: unicorn@forest.od.ua To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: i386/40354: crash, whith floating ops in kernel mode Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 40354 >Category: i386 >Synopsis: crash, whith floating ops in kernel mode >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Jul 08 11:30:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: unicorn >Release: FreeBSD 5.0-CURRENT i386 >Organization: >Environment: System: FreeBSD Rainbow.Deep.Forest 5.0-CURRENT FreeBSD 5.0-CURRENT #10: Sun Jun 23 22:13:00 EEST 2002 root@Rainbow.Deep.Forest:/www/src/sys/i386/compile/RAINBOW i386 >Description: npx dna handler tries to modify curpcb even if it does not exist (yet). it couses page fault in kernel mode. >How-To-Repeat: do some floating point operations before the first process created. >Fix: Index: npx.c =================================================================== RCS file: /mnt/ncvs/src/sys/i386/isa/npx.c,v retrieving revision 1.129 diff -u -r1.129 npx.c --- npx.c 27 Mar 2002 05:39:20 -0000 1.129 +++ npx.c 8 Jul 2002 18:08:06 -0000 @@ -826,21 +826,27 @@ */ PCPU_SET(fpcurthread, curthread); - exstat = GET_FPU_EXSW_PTR(PCPU_GET(curpcb)); - *exstat = 0; - /* - * The following frstor may cause an IRQ13 when the state being - * restored has a pending error. The error will appear to have been - * triggered by the current (npx) user instruction even when that - * instruction is a no-wait instruction that should not trigger an - * error (e.g., fnclex). On at least one 486 system all of the - * no-wait instructions are broken the same as frstor, so our - * treatment does not amplify the breakage. On at least one - * 386/Cyrix 387 system, fnclex works correctly while frstor and - * fnsave are broken, so our treatment breaks fnclex if it is the - * first FPU instruction after a context switch. - */ - fpurstor(&PCPU_GET(curpcb)->pcb_save); + if(PCPU_GET(curpcb) == NULL) + printf("npxdna: Oops! No curpcb!\n"); + else { + exstat = GET_FPU_EXSW_PTR(PCPU_GET(curpcb)); + *exstat = 0; + + /* + * The following frstor may cause an IRQ13 when the state being + * restored has a pending error. The error will appear to have been + * triggered by the current (npx) user instruction even when that + * instruction is a no-wait instruction that should not trigger an + * error (e.g., fnclex). On at least one 486 system all of the + * no-wait instructions are broken the same as frstor, so our + * treatment does not amplify the breakage. On at least one + * 386/Cyrix 387 system, fnclex works correctly while frstor and + * fnsave are broken, so our treatment breaks fnclex if it is the + * first FPU instruction after a context switch. + */ + fpurstor(&PCPU_GET(curpcb)->pcb_save); + } + intr_restore(s); return (1); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message