Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LsYWb-0001PU-NM for qemu-devel@nongnu.org; Sat, 11 Apr 2009 04:25:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LsYWV-0001Ma-8t for qemu-devel@nongnu.org; Sat, 11 Apr 2009 04:25:17 -0400 Received: from [199.232.76.173] (port=49606 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LsYWV-0001MW-5p for qemu-devel@nongnu.org; Sat, 11 Apr 2009 04:25:11 -0400 Received: from mx20.gnu.org ([199.232.41.8]:10221) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LsYWU-0002Fs-Sv for qemu-devel@nongnu.org; Sat, 11 Apr 2009 04:25:11 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LsYWT-0002P6-Qi for qemu-devel@nongnu.org; Sat, 11 Apr 2009 04:25:10 -0400 Message-Id: From: =?ISO-8859-1?Q?Andreas_F=E4rber?= In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: [Qemu-devel] Re: [RFC] OSX/ppc64 TCG support Date: Sat, 11 Apr 2009 10:24:45 +0200 References: Sender: andreas.faerber@web.de Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel 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. > >> 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. > >> #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. Andreas