qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] sh4 linux user emulation on an x86_64 system


From: michael
Subject: [Qemu-devel] sh4 linux user emulation on an x86_64 system
Date: Wed, 15 Oct 2008 19:49:44 +0200
User-agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724)

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







reply via email to

[Prev in Thread] Current Thread [Next in Thread]