From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EU0ZA-0001sG-VF for qemu-devel@nongnu.org; Mon, 24 Oct 2005 07:32:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EU0Z8-0001qU-PN for qemu-devel@nongnu.org; Mon, 24 Oct 2005 07:32:36 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EU0Z8-0001qI-19 for qemu-devel@nongnu.org; Mon, 24 Oct 2005 07:32:34 -0400 Received: from [206.46.252.42] (helo=vms042pub.verizon.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EU0Z8-0004uD-3i for qemu-devel@nongnu.org; Mon, 24 Oct 2005 07:32:34 -0400 Received: from [192.168.1.10] ([71.111.49.104]) by vms042.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IOV00EJL426TW90@vms042.mailsrvcs.net> for qemu-devel@nongnu.org; Mon, 24 Oct 2005 06:32:31 -0500 (CDT) Date: Mon, 24 Oct 2005 04:32:29 -0700 From: Josh Triplett Subject: Re: [Qemu-devel] Re: qemu-ppc fails to run clone with CLONE_VM, threaded programs, non-static programs In-reply-to: <200510231121.20448.a_mulyadi@softhome.net> Message-id: <435CC64D.3070003@psas.pdx.edu> MIME-version: 1.0 Content-type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary=------------enigB7FB258319C9B168C04B78D8 References: <43599151.90802@psas.pdx.edu> <4359E22A.2090904@psas.pdx.edu> <200510231121.20448.a_mulyadi@softhome.net> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: a_mulyadi@softhome.net Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigB7FB258319C9B168C04B78D8 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mulyadi Santosa wrote: > Hello... Hi. >>I worked with pbrook on #qemu to debug this issue. The problem turns >>out to be that qemu's do_fork function on PowerPC zeroes out r7-r31 >>in the new CPU state structure after a clone, which it should not do, > > Josh....at least it proves (to me) that the parameters passed to the > clone() is correct. About the registers....well, this is completely new > for me. > > I wonder, what is the function of those registers (r7-r31)? Something > related with the segments? They are general-purpose registers, mostly used for whatever the process wants to use them for. Zeroing them out from under the child process is a Bad Thing, and is the reason for the bad memory access at a near-zero address. >>as the child's registers should match the parent; it also does not >>zero register r3, which holds the return value and should be zero in >>the child. I've prepared and attached a patch which should solve >>this problem. > > Nice...this is something we surely forgot from out last attempt to debug > the problem....return value. I was too focused on checking every memory > accesses were done inside process address space and function address > translation were done correctly :) Well, there were actually two problems here: the return value and the bad memory access. > Anyway, just a personal suggestion. You can put that patch to > qemu.dad-answers.com along with the description on how you found the > bug and what this patch does. I could post on that forum a link to my previous mail, if that would help. - Josh Triplett --------------enigB7FB258319C9B168C04B78D8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Using GnuPG with Debian - http://enigmail.mozdev.org iD8DBQFDXMZNGJuZRtD+evsRArdSAKCUkC+2ZsOdMLfYgNOG1HZSYhBq6gCgoNLW Co4H+QFg73QJBWu2DKivBzQ= =1pEV -----END PGP SIGNATURE----- --------------enigB7FB258319C9B168C04B78D8--