From: malc <av1474@comtv.ru>
To: "Andreas Färber" <andreas.faerber@web.de>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Re: [RFC] OSX/ppc64 TCG support
Date: Sat, 11 Apr 2009 13:51:20 +0400 (MSD) [thread overview]
Message-ID: <Pine.LNX.4.64.0904111344460.6863@linmac.oyster.ru> (raw)
In-Reply-To: <B169CD2B-FEDF-4AEC-9A32-A7E81D4873A3@web.de>
On Sat, 11 Apr 2009, Andreas F?rber wrote:
>
> Am 11.04.2009 um 09:22 schrieb malc:
>
> > On Sat, 11 Apr 2009, Andreas F?rber wrote:
> > >
> > > ii) In ppc64/tcg-target.c tcg_target_call_oarg_regs is declared with a
> > > length of 2 but only contains one register. Intended?
> >
> > Probably not, then again i'd have to recheck PPC64 ABI for DI/struct
> > returns to be sure, then again QEMU doesn't sue those. Anyhow...
> >
> > > diff --git a/tcg/ppc64/tcg-target.c b/tcg/ppc64/tcg-target.c
> > > index a96314c..2a8eaec 100644
> > > --- a/tcg/ppc64/tcg-target.c
> > > +++ b/tcg/ppc64/tcg-target.c
> > > @@ -125,11 +134,15 @@ static const int tcg_target_call_iarg_regs[] = {
> > > TCG_REG_R10
> > > };
> > >
> > > -static const int tcg_target_call_oarg_regs[2] = {
> > > +static const int tcg_target_call_oarg_regs[1] = {
> > > TCG_REG_R3
> > > };
> >
> > This is most certainly is just as in correct as having it at [2] and
> > not initializing element N1 since main tcg proper never invokes ARRAY_SIZE
> > on tcg_target_call_oarg_regs...
>
> Oops, I must have confused this with iargs, there the ARRAY_SIZE is
> checked in tcg_target_get_call_iarg_regs_count. Anyway, I had
> already tried adding TCG_REG_R4 like for ppc, without noticeable
> difference.
I just checked the document you linked to and PPC-elf64abi and thing is:
1. Mac OS X passes
struct { long a; long b; };
value in R3 and R4
2. PPC-elf64abi adhered systems don't
3. There is no 128bit integral type defined by either ABI (and QEMU
doesn't use use anyway)
So adding R4 there makes little sense in the general scheme of things
(I'd have put trap representation there, but alas neither ABI defines
one)
> >
> > > Unfortunately qemu-system-ppc still crashes immediately, any hints
> > > welcome.
> > >
> > > Program received signal EXC_BAD_INSTRUCTION, Illegal instruction/operand.
> > > 0x00000000005a9680 in code_gen_prologue ()
> > > (gdb) bt
> >
> > I think TOCs are a lot different in ppc-elf64abi and Mach-O one, that
> > would explain why it fails so early
>
> Could you please elaborate on that? I am still not familiar with the topic. Do
> you mean I would have to initialize the TOC field of the function descriptor?
> Or in which other parts of the code would I need to make adjustments for those
> TOCs?
> In the above ABI document neither function descriptors nor TOCs are mentioned
> at all.
I recall reading a post by an Apple engineer on some Apple mailing
list detailing the differences between Mach-O and ELF64 ABIs, but i
can't find it now.
> >
> > > #0 0x00000000005a9680 in code_gen_prologue ()
> >
> > [..snip..]
> >
> > Unfortunatelly i don't have access to MacOSX on a PPC64 so you are on your
> > own there.
>
> I know, you said so. Still any hints where to dig or advice how to debug this
> with gdb would be helpful.
Well:
gdb --args qemu-... [qemu args...]
and once it crashes:
x/10i $pc and info registers
If you want you can send the output to me off-list.
--
mailto:av1474@comtv.ru
prev parent reply other threads:[~2009-04-11 9:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-10 22:34 [Qemu-devel] [RFC] OSX/ppc64 TCG support Andreas Färber
[not found] ` <A3BEB1B2-95F6-4E26-87FD-B58DA752C9C8@hotmail.com>
2009-04-11 3:34 ` C.W. Betts
2009-04-11 7:22 ` [Qemu-devel] " malc
2009-04-11 8:24 ` Andreas Färber
2009-04-11 9:51 ` malc [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=Pine.LNX.4.64.0904111344460.6863@linmac.oyster.ru \
--to=av1474@comtv.ru \
--cc=andreas.faerber@web.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).