Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Jun 2006 22:26:39 +0200
From:      Juergen Lock <nox@jelal.kn-bremen.de>
To:        nikolas.britton@gmail.com
Cc:        freebsd-emulation@freebsd.org
Subject:   Re: QEMU: npxdna: fpcurthread == curthread 640962 times
Message-ID:  <20060616202639.GA4519@saturn.kn-bremen.de>
In-Reply-To: <200606161855.k5GItlP1001526@saturn.kn-bremen.de>
References:  <ef10de9a0606131730m7ec33522q2b2273eb3d44d603@mail.gmail.com> <200606161855.k5GItlP1001526@saturn.kn-bremen.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jun 16, 2006 at 08:55:47PM +0200, Juergen Lock wrote:
> In article <ef10de9a0606131730m7ec33522q2b2273eb3d44d603@mail.gmail.com> you write:
> >I'm getting these messages on the console when I run QEMU with kqemu
> >kernel module:
> >npxdna: fpcurthread == curthread 640957 times
> >npxdna: fpcurthread == curthread 640958 times
> >npxdna: fpcurthread == curthread 640959 times
> >npxdna: fpcurthread == curthread 640960 times
> >npxdna: fpcurthread == curthread 640961 times
> >npxdna: fpcurthread == curthread 640962 times
> >
> >What are these and how do I make them stop?
> >[...]
> 
> Ok since the previous thread on this,
>     http://lists.freebsd.org/pipermail/freebsd-emulation/2006-May/002081.html
> didnt end with a consensus on how to fix it, I've made a band-aid
> patch that simply disables the message for the kqemu case: (which
> _appears_ to be harmless there, maybe because qemu doesnt seem to
> be using the fpu while calling kqemu)
> 
> Index: sys/i386/isa/npx.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/i386/isa/npx.c,v
> retrieving revision 1.162.2.1.2.2
> diff -u -r1.162.2.1.2.2 npx.c
> --- sys/i386/isa/npx.c	30 Apr 2006 05:17:59 -0000	1.162.2.1.2.2
> +++ sys/i386/isa/npx.c	16 Jun 2006 18:03:23 -0000
> @@ -756,6 +756,9 @@
>  	if (!npx_exists)
>  		return (0);
>  	if (PCPU_GET(fpcurthread) == curthread) {
> +#if 1
> +		if (strcmp(curthread->td_proc->p_comm, "qemu"))
> +#endif
>  		printf("npxdna: fpcurthread == curthread %d times\n",
>  		    ++err_count);
>  		stop_emulating();
> 
>  Of course I don't ask for something like this be committed, it is just
> for ppl for who the messages cause trouble.  Similar patch for amd64
> (untested):
> 
> Index: sys/amd64/amd64/trap.c
>[...]

Ooops, that was wrong of course, :) and I forgot about the second place.
Here is a working amd64 patch:

Index: sys/amd64/amd64/fpu.c
===================================================================
RCS file: /home/ncvs/src/sys/amd64/amd64/fpu.c,v
retrieving revision 1.154.2.1
diff -u -r1.154.2.1 fpu.c
--- sys/amd64/amd64/fpu.c	5 Feb 2005 01:02:48 -0000	1.154.2.1
+++ sys/amd64/amd64/fpu.c	16 Jun 2006 18:00:40 -0000
@@ -387,6 +387,9 @@
 	register_t s;
 
 	if (PCPU_GET(fpcurthread) == curthread) {
+#if 1
+		if (strcmp(curthread->td_proc->p_comm, "qemu-system-x86_64"))
+#endif
 		printf("fpudna: fpcurthread == curthread %d times\n",
 		    ++err_count);
 		stop_emulating();
Index: sys/amd64/amd64/trap.c
===================================================================
RCS file: /home/ncvs/src/sys/amd64/amd64/trap.c,v
retrieving revision 1.279.2.2.4.1
diff -u -r1.279.2.2.4.1 trap.c
--- sys/amd64/amd64/trap.c	1 May 2005 05:38:12 -0000	1.279.2.2.4.1
+++ sys/amd64/amd64/trap.c	16 Jun 2006 18:00:49 -0000
@@ -348,6 +348,9 @@
 			 * registered such use.
 			 */
 			if (fpudna()) {
+#if 1
+				if (strcmp(td->td_proc->p_comm, "qemu-system-x86_64"))
+#endif
 				printf("fpudna in kernel mode!\n");
 				goto out;
 			}




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