Skip to contentSkip to conversation

PPC: Regression booting NetBSD

Qemu-devel Mark Cave-Ayland 2 participants 3 messages Dec 10, 2013

lore
Share & tools
lore
#0 lore raw

Hi all,

I've been running my OpenBIOS test suite on a recent git (commit a1d22a) and have encountered a QEMU process segfault in 2 out of 3 of my NetBSD 5.0.2 boot attempts. Does anyone have an idea what could be causing this? Other OSs don't seem to be affected.

build@kentang:~/rel-qemu-git/bin$ ./qemu-system-ppc -cdrom /home/build/src/qemu/image/ppc/macppccd-5.0.2.iso -boot d -bios /home/build/src/openbios/openbios-git/openbios-devel/obj-ppc/openbios-qemu.elf.nostrip 

qemu: fatal: Trying to execute code outside RAM or ROM at 0x0a64696c

NIP 0a64696c LR 0a64696d CTR 00000000 XER 00000000
MSR 00009030 HID0 00000000 HF 00000000 idx 1
TB 00000000 251528018 DECR 00115603
GPR00 000000000a64696d 00000000fff4b930 0000000007e00000 0000000000000000 GPR04 0000000000000000 00000000fff4bac4 0000000000009000 0000000000009030 GPR08 00000000000056c0 0000000007e00000 00000000000006ad 00000000005d6f58 GPR12 0000000000000003 0000000000000000 0000000000000000 0000000000000000 GPR16 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR20 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR24 0000000000000000 0000000080020400 0000000000000000 00000000005a0000 GPR28 0000000000000000 000000000036bdd4 0000000007e00000 00000000fff4ba28
CR 20009038 [ E - - - LO - EO L ] RES ffffffff
FPR00 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR04 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR08 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR12 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR16 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR20 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR24 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR28 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPSCR 00000000
SRR0 72657370 SRR1 10009030 PVR 00080301 VRSAVE 00000000

SPRG0 07e00000 SPRG1 fff4bae0  SPRG2 00000000  SPRG3 0000000e
SPRG4 00000000 SPRG5 00000000  SPRG6 00000000  SPRG7 00000000
 SDR1 0060000f
Aborted
build@kentang:~/rel-qemu-git/bin$ ./qemu-system-ppc -cdrom /home/build/src/qemu/image/ppc/macppccd-5.0.2.iso -boot d -bios /home/build/src/openbios/openbios-git/openbios-devel/obj-ppc/openbios-qemu.elf.nostrip 

qemu: fatal: Trying to execute code outside RAM or ROM at 0x080065b4

NIP 080065b4 LR 080065b5 CTR 00000000 XER 00000000
MSR 00001032 HID0 00000000 HF 00000000 idx 1
TB 00000000 236481426 DECR 00044157
GPR00 00000000080065b5 00000000fff4b720 0000000007e00000 0000000000000000 GPR04 000000000f080d10 0000000008160820 0000000000000002 0000000000001032 GPR08 00000000000056c0 0000000007e00000 00000000000006af 00000000005d6f58 GPR12 0000000000000003 0000000000000000 0000000000000000 0000000000000000 GPR16 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR20 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR24 0000000000000000 0000000080020400 0000000000000000 00000000005a0000 GPR28 0000000000000000 000000000036bdd4 0000000007e00000 00000000fff4b818
CR 20001034 [ E - - - -O - EO G ] RES ffffffff
FPR00 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR04 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR08 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR12 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR16 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR20 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR24 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR28 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPSCR 00000000
SRR0 0024eeec SRR1 00001030 PVR 00080301 VRSAVE 00000000

SPRG0 07e00000 SPRG1 fff4b8d0  SPRG2 00000000  SPRG3 0000000e
SPRG4 00000000 SPRG5 00000000  SPRG6 00000000  SPRG7 00000000

SDR1 0060000f
Aborted

ATB,

Mark.

#1 lore raw
Quoted 6 lines · Mark Cave-Ayland

I've been running my OpenBIOS test suite on a recent git (commit a1d22a) and have encountered a QEMU process segfault in 2 out of 3 of my NetBSD 5.0.2 boot attempts. Does anyone have an idea what could be causing this? Other OSs don't seem to be affected.

Quoted 7 lines
build@kentang:~/rel-qemu-git/bin$ ./qemu-system-ppc -cdrom
/home/build/src/qemu/image/ppc/macppccd-5.0.2.iso -boot d -bios
/home/build/src/openbios/openbios-git/openbios-devel/obj-ppc/openbios-qemu.elf.nostrip
qemu: fatal: Trying to execute code outside RAM or ROM at 0x0a64696c

NIP 0a64696c LR 0a64696d CTR 00000000 XER 00000000
MSR 00009030 HID0 00000000 HF 00000000 idx 1

[etc]

This isn't a QEMU process segfault -- it's just that the guest has attempted to jump to a memory location which is neither RAM nor ROM (you can see the guest NIP is the same address the message prints). This is probably because something has gone wrong some distance further back in guest execution; identifying exactly what that was might require some tedious debugging :-)

thanks
-- PMM

#2 lore raw
Quoted 18 lines · Peter Maydell
Quoted 6 lines · Mark Cave-Ayland

I've been running my OpenBIOS test suite on a recent git (commit a1d22a) and have encountered a QEMU process segfault in 2 out of 3 of my NetBSD 5.0.2 boot attempts. Does anyone have an idea what could be causing this? Other OSs don't seem to be affected.

Quoted 7 lines
build@kentang:~/rel-qemu-git/bin$ ./qemu-system-ppc -cdrom
/home/build/src/qemu/image/ppc/macppccd-5.0.2.iso -boot d -bios
/home/build/src/openbios/openbios-git/openbios-devel/obj-ppc/openbios-qemu.elf.nostrip
qemu: fatal: Trying to execute code outside RAM or ROM at 0x0a64696c

NIP 0a64696c LR 0a64696d CTR 00000000 XER 00000000
MSR 00009030 HID0 00000000 HF 00000000 idx 1

[etc]

Quoted 7 lines

This isn't a QEMU process segfault -- it's just that the guest has attempted to jump to a memory location which is neither RAM nor ROM (you can see the guest NIP is the same address the message prints). This is probably because something has gone wrong some distance further back in guest execution; identifying exactly what that was might require some tedious debugging :-)

Well after some fiddling today, it seems that subtle changes in the memory layout between different revisions of OpenBIOS cause NetBSD to crash with the default 128M of RAM provided by QEMU. With 256M specified on the command line then everything works as before.

My guess is that in the case where QEMU doesn't crash, we're just lucky in that whatever memory corruption is occurring doesn't manage to trigger the assertion in the emulator.

ATB,

Mark.