Skip to contentSkip to conversation

Problem with QEMU on PPC

Qemu-devel Helmar Wodtke 2 participants 2 messages Nov 6, 2004

lore
Share & tools
lore
#0 lore raw
Quoted 11 lines

Hi,

Quoted 5 lines · Helmar Wodtke

I want to run x86 code (more specific my FORTH at
http://www.printly.de/HelFORTH/ ) with user mode emulation on PPC linux. I've made some debugging and figured out that the following code (for fasm)
does not run:

Means segmentation fault? Or does not start? Or does nothing?

It says:

helmar@imac helforth04b $ bin/qemu-i386 hf
()<1234567qemu: uncaught target signal 11 (Segmentation fault) - exiting helmar@imac helforth04b $ bin/qemu-i386 test
qemu: uncaught target signal 11 (Segmentation fault) - exiting helmar@imac helforth04b $

The first command is my FORTH with some debugging code I added and "test" is the code I send in last mail. BTW: Does the segmentation fault message mean it's the emulator or it's the program?

Quoted 6 lines
Quoted 2 lines

x86/x86 works fine, so I think this is a bug in PPC version. Also "inc dword [bla[" would work.

Tip: Enable single stepping, enable all logging (or at least in_asm and cpu) and then compare between PPC and x86 host. You should get an idea which insn is causing the glitch.

How? Can you point me to documentation? I dont know structure of QEMU well - as far as I've seen there are a lot optimisations for PCC. I dont understand PPC-assembler and dont like to learn it for this problem (I would implement a C-FORTH instead...).

Bis dann,
Helmar

BEGIN:VCARD
VERSION:2.1
N:Wodtke;Helmar;;;
FN:Helmar Wodtke
ADR;HOME:;;Hauptstra�e 12;Belgershain;;04683;Deutschland EMAIL;INTERNET:[email protected] EMAIL;INTERNET:[email protected]
END:VCARD

#1 lore raw

Hi,

Quoted 4 lines · Helmar Wodtke

helmar@imac helforth04b $ bin/qemu-i386 hf
()<1234567qemu: uncaught target signal 11 (Segmentation fault) - exiting helmar@imac helforth04b $ bin/qemu-i386 test
qemu: uncaught target signal 11 (Segmentation fault) - exiting

This means that QEmu tries to access memory which was not mapped, i.e. something like *(char*)0x0.

Quoted 8 lines
Quoted 3 lines

Tip: Enable single stepping, enable all logging (or at least in_asm and cpu) and then compare between PPC and x86 host. You should get an idea which insn is causing the glitch.

How? Can you point me to documentation? I dont know structure of QEMU well - as far as I've seen there are a lot optimisations for PCC. I dont understand PPC-assembler and dont like to learn it for this problem (I would implement a C-FORTH instead...).

If you look into target-i386/translate.c, and search for CF_SINGLE_INSN, you will probably know what I mean. Just make the if() succeed all the time (so that only one insn is translated into one Translated Block).

BTW, PPC-assembler is not that complicated. And I think it'd be good to squash that bug.

Hth,
Dscho