All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Triplett <josh@psas.pdx.edu>
To: a_mulyadi@softhome.net
Cc: qemu-devel@nongnu.org
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	[thread overview]
Message-ID: <435CC64D.3070003@psas.pdx.edu> (raw)
In-Reply-To: <200510231121.20448.a_mulyadi@softhome.net>

[-- Attachment #1: Type: text/plain, Size: 1589 bytes --]

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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]

      reply	other threads:[~2005-10-24 11:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-22  1:09 [Qemu-devel] qemu-ppc fails to run clone with CLONE_VM, threaded programs, non-static programs Josh Triplett
2005-10-22  6:54 ` [Qemu-devel] " Josh Triplett
2005-10-23  4:21   ` Mulyadi Santosa
2005-10-24 11:32     ` Josh Triplett [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=435CC64D.3070003@psas.pdx.edu \
    --to=josh@psas.pdx.edu \
    --cc=a_mulyadi@softhome.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.