From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KqAVr-0003nE-4x for qemu-devel@nongnu.org; Wed, 15 Oct 2008 13:50:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KqAVp-0003n2-E6 for qemu-devel@nongnu.org; Wed, 15 Oct 2008 13:50:22 -0400 Received: from [199.232.76.173] (port=36708 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KqAVp-0003mz-98 for qemu-devel@nongnu.org; Wed, 15 Oct 2008 13:50:21 -0400 Received: from ms01.sssup.it ([193.205.80.99]:53084 helo=sssup.it) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KqAVo-00076B-UE for qemu-devel@nongnu.org; Wed, 15 Oct 2008 13:50:21 -0400 Received: from [193.205.82.7] (HELO gandalf.sssup.it) by sssup.it (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 45873037 for qemu-devel@nongnu.org; Wed, 15 Oct 2008 19:49:18 +0200 Received: from [10.30.3.184] (vpn01.retis [10.30.3.184]) by gandalf.sssup.it (8.12.10/8.12.10) with ESMTP id m9FGe5Vr016456 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 15 Oct 2008 18:40:30 +0200 Message-ID: <48F62D38.50001@gandalf.sssup.it> Date: Wed, 15 Oct 2008 19:49:44 +0200 From: michael MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] sh4 linux user emulation on an x86_64 system 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 Hi all, I have some trouble using the qemu emulator on the x86_64 host system. The system emulate an qemu-sh4 machine. I try to fix it without success: if I run: qemu-sh4-32 I don't have problems. I have the log and the program run ok. If I recompile for the qemu-sh4-64 the system crash. I find the reason of the crash, but the problem appears early in the generated code. The effect is the env variabile env->pr is filled with an an invalid value then the pr is taken by the delayed_pc and finally by the pc. The %r14 register point to the CPUState structure OUT: [size=242] 0x6018c9e0: mov 0x28(%r14),%edi 0x6018c9e4: mov 0x40(%r14),%esi 0x6018c9e8: add $0x60,%esi 0x6018c9eb: mov %rsi,%rdx 0x6018c9ee: mov %edx,0x44(%r14) 0x6018c9f2: mov %esi,0x40(%r14) 0x6018c9f6: mov %edi,0x8(%r14) 0x6018c9fa: movslq (%rdx),%rdi 0x6018c9fd: mov 0x44(%r14),%esi 0x6018ca01: add $0x4,%esi 0x6018ca04: mov %rsi,%rdx 0x6018ca07: mov %esi,0x44(%r14) 0x6018ca0b: mov %edi,0x114(%r14) <--- the %edi is invalid and here I set the env->pr the pr is then copied to the delayed_pc and then in the pc. variabile Then the system crash with an access violation. I set a break condition and a watch point to trace down the problem and try to compare the i386 code with the x86_64 code. It appears that the problem is before. It is a problem if the regs_to_env and env_to_regs are not implemented during a longjmp and setjmp. Regards Michael