On Fri, 7 Mar 2025, Andrew Randrianasulu wrote:
> I posted to linuxppc-dev list nut no answer so far meanwhile I booted
Maybe there aren't much more people interested in PPC on the linux list
that are not here. You may more likely get an answer if you can ask
specific questions. I don't expect people to go through this long thread
just to get the question so you may need to describe the problem (and for
that we need to fully understand it first). So far it seems there might be
some issue when getting decrementer interrupt with SMP or a problem with
setting up MMU on CPU1.
> FreeBSD 14.2, it boots with smp 1 and panic/reboot with -smp 2
>
> ./qemu-system-ppc64 -M mac99,via=pmu -smp 2 -cpu g4 -m 2g -bios
> ~/K38_sdcard1/Documents/openbios-qemu-smp.elf -cdrom
> ~/Downloads/FreeBSD-14.2-RELEASE-powerpc-bootonly.iso -boot d -accel
> tcg,thread=multi -nographic
>
> it [Enter] to boot immediately, or any other key for command prompt.
> Booting [/boot/kernel/kernel]...
> Kernel entry at 0x100590 ...
> ---<<BOOT>>---
There's not much in this about SMP, only that it detected two CPUs. It
does not log if it started the second one or was that successful so I
don't know what happened.
> gem0: 20kB RX FIFO, 9kB TX FIFO
> gem0: Ethernet address: 52:54:00:12:34:56
> Timecounter "timebase" frequency 25000000 Hz quality 1000
> Event timer "decrementer" frequency 25000000 Hz quality 1000
> Timecounters tick every 1.000 msec
>
> fatal kernel trap:
>
> exception = 0x600 (alignment)
> virtual address = 0x42
> srr0 = 0x5bd888 (0x5bd888)
> srr1 = 0x32
> current msr = 0x32
> lr = 0x5bd870 (0x5bd870)
> frame = 0xd0004648
> curthread = 0
>
> panic: alignment trap
> cpuid = 0
> time = 1
> KDB: stack backtrace:
> #0 0x6608d8 at kdb_backtrace+0x80
> #1 0x5f1c40 at vpanic+0x1e0
> #2 0x5f1a5c at panic+0x64
> #3 0xa2e074 at trap+0x748
> #4 0xa23928 at powerpc_interrupt+0x170
This seems to be related to DECR again which is one of the exceptions
that's handled in powerpc_interrupt but I don't know what's offset 0x170
in that function and why it broke.
It was mostly just easy testing case, not serious investigation.
I also found this email saying that at least for newer ppc cores on ppc64 second cpu must be started with decr interrupt disabled.
may be we need something like this but for mac99 machine?
I also noticed that default gtk3 display tend to "freeze" mouse in SMP OS 9.2.2 guest, but -display sdl worked fine so far. Set up host ftp server for file transfers.
Also mac99 machine now segfaults if you just ran -M mac99 -smp 2, instead of -M mac99,via=pmu -smp 2.
I guess this is bug?
You could try to find the source line
for this address (0xa23928) and see where the virtual address 0x42 comes
from which does not seem to be a correct address. But why does it only
break with SMP? Or I'm not sure the backtrace is correct as the trap
report talks about addresses around 0x5bd870-0x5bd888 so it could be
that's where the exception happens so the place to look for the source of
that 0x42 value.
Regards,
BALATON Zoltan