Date: Sun, 20 Feb 2005 20:14:08 +1100 (EST) From: Bruce Evans <bde@zeta.org.au> To: Alexander Leidinger <Alexander@Leidinger.net> Cc: freebsd-amd64@FreeBSD.org Subject: Re: kernel message while running icc-em64t Message-ID: <20050220190416.H4624@epsplex.bde.org> In-Reply-To: <20050219214719.2b4c8c59@Magellan.Leidinger.net> References: <41F62EE7.6070808@fsn.hu> <20050216110434.rmi718fcw0o44sgs@netchild.homeip.net> <421337C2.7040800@fsn.hu> <200502171411.15827.peter@wemm.org> <20050219214719.2b4c8c59@Magellan.Leidinger.net>
index | next in thread | previous in thread | raw e-mail
On Sat, 19 Feb 2005, Alexander Leidinger wrote:
> On Thu, 17 Feb 2005 14:11:15 -0800
> Peter Wemm <peter@wemm.org> wrote:
>
> > > >> fpudna: fpcurthread == curthread 2342 times
> > > >> fpudna: fpcurthread == curthread 2343 times
>
> > If I had to guess, I'd guess that it is trying to issue SSE3
> > instructions to see if they work..
Does SSE3 cause DNA traps that are not associated with the FPU and/or
not cleared by calling stop_emulating()?
> I think the question is: Does this needs to get printed and if yes,
> does the information it represents has to be that cryptic?
This needs to panic like it used to, and the broken invariant reported
by the panic needs to be fixed instead of mishandled.
The panic was broken in rev.1.131 of npx.c.
I use the following fix for the non-panic and for some nearby style
(-only?) bugs:
%%%
Index: npx.c
===================================================================
RCS file: /home/ncvs/src/sys/i386/isa/npx.c,v
retrieving revision 1.152
diff -u -2 -r1.152 npx.c
--- npx.c 19 Jun 2004 22:24:16 -0000 1.152
+++ npx.c 20 Feb 2005 07:49:45 -0000
@@ -764,7 +764,4 @@
* access foreign pcb's.
*/
-
-static int err_count = 0;
-
int
npxdna()
@@ -776,18 +773,8 @@
if (!npx_exists)
return (0);
- if (PCPU_GET(fpcurthread) == curthread) {
- printf("npxdna: fpcurthread == curthread %d times\n",
- ++err_count);
- stop_emulating();
- return (1);
- }
- if (PCPU_GET(fpcurthread) != NULL) {
- printf("npxdna: fpcurthread = %p (%d), curthread = %p (%d)\n",
- PCPU_GET(fpcurthread),
- PCPU_GET(fpcurthread)->td_proc->p_pid,
- curthread, curthread->td_proc->p_pid);
- panic("npxdna");
- }
s = intr_disable();
+ if (PCPU_GET(fpcurthread) != NULL)
+ panic("npxdna: fpcurthread = %p, curthread = %p",
+ (void *)PCPU_GET(fpcurthread), (void *)curthread);
stop_emulating();
/*
%%%
The changes here are:
- back out the bogus code related to this bug in rev.1.131, so that
there is a panic again and not too much code for (mis)handing a case
that can't happen.
- move the invariant check inside the critical region. I think it was
OK, but this depends on the delicate point that interrupts can only
change fpcurthread from non-null to null, and since we are asserting
that fpcurthread is null, it shouldn't change underneath us. See
rev.1.90 for the addition of the critical region.
- catch up with 4.4BSD and use panic()'s support for variadic args
- don't invoke undefined behaviour by printing non-`void *'s using %p
- use KNF continuation indent of 4 (npx.c gets this wrong in several
places since I didn't know the rule when I wrote most of npx.c).
Bruce
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050220190416.H4624>
