Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Bxmjx-0004t4-Rl for qemu-devel@nongnu.org; Thu, 19 Aug 2004 09:14:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Bxmju-0004sr-BZ for qemu-devel@nongnu.org; Thu, 19 Aug 2004 09:14:01 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bxmju-0004so-7p for qemu-devel@nongnu.org; Thu, 19 Aug 2004 09:13:58 -0400 Received: from [206.190.39.135] (helo=web52510.mail.yahoo.com) by monty-python.gnu.org with smtp (Exim 4.34) id 1BxmfB-0007va-Cl for qemu-devel@nongnu.org; Thu, 19 Aug 2004 09:09:05 -0400 Message-ID: <20040819115636.96408.qmail@web52510.mail.yahoo.com> Date: Thu, 19 Aug 2004 04:56:36 -0700 (PDT) From: Piotr Krysik MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-1410398184-1092916596=:96023" Subject: [Qemu-devel] qemu-fast on Debian 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 --0-1410398184-1092916596=:96023 Content-Type: text/plain; charset=us-ascii Content-Id: Content-Disposition: inline Hi! While testing qemu-fast on Debian/unstable host I noticed two problems: * for some combination gcc and flags used to compile qemu I get "Illegal instruction" fault; * when using -d xxxx option, I always get "Segmentation fault". I get "Illegal instruction" fault when code generated by gcc uses different policy for storing outgoing parameters then assumed in qemu. For example op_jz_ecxw_im may be compiled as: 5db0: sub $0x4,%esp 5db3: cmpw $0x0,0x4(%ebp) 5db8: jne 5de3 5dba: testb $0x1,0x25(%ebp) 5dbe: movl $0x0,0x20(%ebp) 5dc5: je 5de0 5dc7: movl $0x1,(%esp) 5dce: call 5dcf 5dd3: lea 0x0(%esi),%esi 5dd9: lea 0x0(%edi),%edi 5de0: xor %ebx,%ebx 5de2: ret 5de3: pop %ecx 5de4: ret When block is exited by ret at 5de2, the stack pointer is not correctly restored. The ret comes from EXIT_TB(). To fix the problem I propose to store stack pointer in a variable (new CPUState field?) before entering translated code and restore it on exit. Does anyone have better idea? The second problem is probably caused by memory layout inconsistent with glibc assumption. I'm attaching a patch to work-around the problem (tested with libc6-dev 2.3.2.ds1-16). Regards, Piotrek __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --0-1410398184-1092916596=:96023 Content-Type: application/x-tar; name="fast-glibc-0.patch.gz" Content-Transfer-Encoding: base64 Content-Description: fast-glibc-0.patch.gz Content-Disposition: attachment; filename="fast-glibc-0.patch.gz" H4sICP6DJEEAA2Zhc3QtZ2xpYmMtMC5wYXRjaACVUNtqwkAQfe5+xZS+aOLq Zo0alYK1XqHRouahlLKsyUYXcrFJ1EJ/vklMbwiWzsvOzJk558w60nUBR3t4 Ff4exwHfxdswwZQQHRMDE53Reu3gVe1LA9jlcYI3nlzb+SzCGP9JePXdAkI6 pN2pkyr5DFBJiiNVVf8j/MWptYDSTr3R0dpnnL0eYNrQjUoT1Pw1oNdDcOMI VwYCZsMVm46YtRwuALSz/sAyzSegCJAq3hIRBWBveQQKY7tkGwnuMBnIRHKP FeU6jLtIRSCDBHwug1KW8GhjV4pNJS0OZQTvqZZ0UzW4n89G0zEbD/rLldUv DLfIyXCLFoazyBn8MFUMI+aIg7TFs0aNl+4POBZRZuc3itQMv2QaboHkxlNT cH36BKdUWFvORyvTtMonmZoCRwGBOIgIjjw9L9ny7FjPC+1SGfaxiMH3+S7N ldppJQd3Sclkpnn3yFaTxXA5mT8MKqCTdhMU0AjVy130AdJlGTSgAgAA --0-1410398184-1092916596=:96023--