From owner-freebsd-emulation@FreeBSD.ORG Fri Jun 16 20:28:35 2006 Return-Path: X-Original-To: freebsd-emulation@freebsd.org Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B2D4916A474 for ; Fri, 16 Jun 2006 20:28:35 +0000 (UTC) (envelope-from nox@saturn.kn-bremen.de) Received: from gwyn.kn-bremen.de (gwyn.kn-bremen.de [212.63.36.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9ECE343D7D for ; Fri, 16 Jun 2006 20:28:21 +0000 (GMT) (envelope-from nox@saturn.kn-bremen.de) Received: from gwyn.kn-bremen.de (gwyn [127.0.0.1]) by gwyn.kn-bremen.de (8.13.4/8.13.4/Debian-3sarge1) with ESMTP id k5GKSKVb000654 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 16 Jun 2006 22:28:20 +0200 Received: from saturn.kn-bremen.de (uucp@localhost) by gwyn.kn-bremen.de (8.13.4/8.13.4/Submit) with UUCP id k5GKSK2R000651; Fri, 16 Jun 2006 22:28:20 +0200 Received: from saturn.kn-bremen.de (nox@localhost [127.0.0.1]) by saturn.kn-bremen.de (8.13.6/8.13.6) with ESMTP id k5GKQeDl004675; Fri, 16 Jun 2006 22:26:40 +0200 (CEST) (envelope-from nox@saturn.kn-bremen.de) Received: (from nox@localhost) by saturn.kn-bremen.de (8.13.6/8.13.6/Submit) id k5GKQdMB004674; Fri, 16 Jun 2006 22:26:39 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Fri, 16 Jun 2006 22:26:39 +0200 To: nikolas.britton@gmail.com Message-ID: <20060616202639.GA4519@saturn.kn-bremen.de> Mail-Followup-To: nikolas.britton@gmail.com, freebsd-emulation@freebsd.org References: <200606161855.k5GItlP1001526@saturn.kn-bremen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200606161855.k5GItlP1001526@saturn.kn-bremen.de> User-Agent: Mutt/1.5.11 Cc: freebsd-emulation@freebsd.org Subject: Re: QEMU: npxdna: fpcurthread == curthread 640962 times X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jun 2006 20:28:35 -0000 On Fri, Jun 16, 2006 at 08:55:47PM +0200, Juergen Lock wrote: > In article 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; }