QEMU: npxdna: fpcurthread == curthread 640962 times

Juergen Lock nox at jelal.kn-bremen.de
Fri Jun 16 18:57:57 UTC 2006


In article <ef10de9a0606131730m7ec33522q2b2273eb3d44d603 at 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
===================================================================
RCS file: /home/ncvs/src/sys/amd64/amd64/trap.c,v
retrieving revision 1.289.2.3
diff -u -r1.289.2.3 trap.c
--- sys/amd64/amd64/trap.c	28 Nov 2005 20:03:03 -0000	1.289.2.3
+++ sys/amd64/amd64/trap.c	16 Jun 2006 18:31:01 -0000
@@ -359,6 +359,9 @@
 			 * registered such use.
 			 */
 			if (fpudna()) {
+#if 1
+				if (strcmp(curthread->td_proc->p_comm, "qemu"))
+#endif
 				printf("fpudna in kernel mode!\n");
 				goto out;
 			}

 And finally a question for the experts: could this be fixed for real
once the dfly fpu patch mentioned in the `Adding optimized kernel
copying support' thread,
    http://lists.freebsd.org/pipermail/freebsd-arch/2006-June/005267.html
is committed?


More information about the freebsd-emulation mailing list