qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: qemu-ppc fails to run clone with CLONE_VM, threaded


From: Josh Triplett
Subject: Re: [Qemu-devel] Re: qemu-ppc fails to run clone with CLONE_VM, threaded programs, non-static programs
Date: Mon, 24 Oct 2005 04:32:29 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051007 Debian/1.7.12-1

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]