From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JXziM-0006LS-10 for qemu-devel@nongnu.org; Sat, 08 Mar 2008 09:07:54 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JXziK-0006KS-9K for qemu-devel@nongnu.org; Sat, 08 Mar 2008 09:07:53 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JXziK-0006KO-5t for qemu-devel@nongnu.org; Sat, 08 Mar 2008 09:07:52 -0500 Received: from fk-out-0910.google.com ([209.85.128.185]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JXziJ-0000il-JD for qemu-devel@nongnu.org; Sat, 08 Mar 2008 09:07:51 -0500 Received: by fk-out-0910.google.com with SMTP id 18so890514fkq.2 for ; Sat, 08 Mar 2008 06:07:49 -0800 (PST) Message-ID: Date: Sat, 8 Mar 2008 16:07:49 +0200 From: "Blue Swirl" Subject: Re: [Qemu-devel] Questions/comments on TCG In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_35747_26422218.1204985269163" References: <20080307123710.GA29683@miranda.arrow> <20080307181942.GA30329@miranda.arrow> <20080307195559.GA30601@miranda.arrow> 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@nongnu.org ------=_Part_35747_26422218.1204985269163 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 3/7/08, Blue Swirl wrote: > On 3/7/08, Stuart Brady wrote: > > On Fri, Mar 07, 2008 at 08:47:03PM +0200, Blue Swirl wrote: > > > On 3/7/08, Stuart Brady wrote: > > > > > > tcg_target_reg_alloc_order[] has 32 elements, but only 14 are used. > > > > The rest hold 0, specifying TCG_REG_G0. > > > > > > I see. That could be asking for trouble. > > > > > > Possibly not, as g0 is marked as reserved, but it looks to me like bug, > > regardless of whether it causes any harm, so I've submitted a patch. > > > > > > > > I don't understand -- o7 is required when returning in exit_tb, so if it > > > > is used, it must be saved and restored. > > > > > > Not exit_tb, but call. > > > > > > Right, op_call does need to link, and that clobbers the link register, > > so it must be restored -- but I've a feeling that this isn't happening. > > I expect you could copy o7 to/from i5 before/after the call (or jmpl)... > > although I'm not sure if you'd also need to save the frame pointer. > > > Another possibility is to add function epilogue with save and add > restore to ret (or use v9 return). I added the save and restore instructions, because if the generated code made any calls, the registers were overwritten. Currently on Sparc64 host a small helloworld program executes until the system call, then Qemu dies with illegal instruction. It looks like this is caused by setjmp/longjmp register mangling bugs in Linux glibc, my workaround does not help. I'd be interested to hear if this works any better on Solaris/Sparc or *BSD/Sparc. On Sparc32 TB linking does not work, so Qemu dies on TB switch. ------=_Part_35747_26422218.1204985269163 Content-Type: text/x-csrc; name=helloworld.c Content-Transfer-Encoding: base64 X-Attachment-Id: f_fdk8teoc Content-Disposition: attachment; filename=helloworld.c I2RlZmluZSBfX0tFUk5FTF9fCiNpbmNsdWRlIDxhc20vdW5pc3RkLmg+CnN0YXRpYyBpbnQgZXJy bm87CnN0YXRpYyBfX2lubGluZV9fIF9zeXNjYWxsMSh2b2lkLGV4aXQsaW50LGV4aXR2YWwpCnN0 YXRpYyBpbmxpbmUgX3N5c2NhbGwzKGludCx3cml0ZSxpbnQsZmQsY29uc3QgY2hhciAqLGJ1Zixs b25nLGNvdW50KQoKaW50IF9zdGFydCgpCnsKICB3cml0ZSgyLCAiSGVsbG8gV29ybGQhXG4iLCBz aXplb2YoIkhlbGxvIFdvcmxkIVxuIikpOwogIGV4aXQoMCk7Cn0K ------=_Part_35747_26422218.1204985269163 Content-Type: application/octet-stream; name=helloworld.sparc32 Content-Transfer-Encoding: base64 X-Attachment-Id: f_fdk8tm4k Content-Disposition: attachment; filename=helloworld.sparc32 f0VMRgECAQAAAAAAAAAAAAACAAIAAAABAAEAlAAAADQAAAIAAAAAAAA0ACAAAwAoAAUABAAAAAEA AAAAAAEAAAABAAAAAAHgAAAB4AAAAAUAAQAAAAAAAQAAAeAAAgHgAAIB4AAAAAAAAAAIAAAABgAB AABkdOVRAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAAAABJ3jv5iQECACAwAAQJIQYdCUECAOQAAA CAEAAACQECAAQAAAKwEAAACB6AAAgcPgCAEAAACd47+I8CegRPInoEj0J6BMghAgBNAHoETEB6BI khAAAtQHoEyR0CAQGoAAA4IQAAiCIAAIwie/9MIHv/SAoH8BBoAABgEAAADCB7/0gKBgAAaAAAYB AAAAwge/9MInv+wQgAAJAQAAAMIHv/SEIAABAwAAgIIQYeDEIEAAghA//8Inv+zCB7/ssBAAAYHo AACBw+AIAQAAAJ3jv5DwJ6BEghAgAdAHoESR0CAQGoAAA4IQAAiCIAAIwie/9MIHv/SAoH8BBoAA DQEAAADCB7/0gKBgAAaAAAQBAAAAEIAABwEAAADCB7/0hCAAAQMAAICCEGHgxCBAAIHoAACBw+AI AQAAAAAAAABIZWxsbyBXb3JsZCEKAAAAAC5zaHN0cnRhYgAudGV4dAAucm9kYXRhAC5ic3MAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAEAAAAGAAEAlAAA AJQAAAE4AAAAAAAAAAAAAAAEAAAAAAAAABEAAAABAAAAAgABAdAAAAHQAAAAEAAAAAAAAAAAAAAA CAAAAAAAAAAZAAAACAAAAAMAAgHgAAAB4AAAAAgAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAMAAAAA AAAAAAAAAeAAAAAeAAAAAAAAAAAAAAABAAAAAA== ------=_Part_35747_26422218.1204985269163--