qemu-ppc
[Top][All Lists]
Advanced

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

Re: mac99 SMP


From: Andrew Randrianasulu
Subject: Re: mac99 SMP
Date: Sat, 1 Mar 2025 22:18:24 +0300



сб, 1 мар. 2025 г., 19:31 Andrew Randrianasulu <randrianasulu@gmail.com>:
On Sat, Mar 1, 2025 at 6:10 PM Andrew Randrianasulu
<randrianasulu@gmail.com> wrote:
>
> On Sat, Mar 1, 2025 at 5:53 PM BALATON Zoltan <balaton@eik.bme.hu> wrote:
> >
> > On Sat, 1 Mar 2025, Andrew Randrianasulu wrote:
> > > сб, 1 мар. 2025 г., 03:27 BALATON Zoltan <balaton@eik.bme.hu>:
> > >>> Raise exception at c0011040 => ISI (3) error=40000000
> > >>> Raise exception at c0019b70 => ISI (3) error=40000000
> > >>> Raise exception at c0019b70 => ISI (3) error=40000000
> > >>> [Then this repeats endlessly with some timer and decrementer interrupts from
> > >>> CPU0 inbetween.]
> > >>>
> > >>> It's not clear to me where this is coming from and how to debug this further.
> > >>> Maybe MMU setup of CPU1 is not correct or on real hardware this does not
> > >>> happen for some reason? How to trace execution of CPU1? Is there a way to do
> > >>> that from debugger or only get -d in_asm log for one CPU? I have no
> > >>> experience with SMP debugging so I don't know how to progress from here and
> > >>> some help would be needed to go further than this.
> > >
> > > I found few Debian ppc/smp kernels at
> > >
> > > http://ftp.ports.debian.org/debian-ports/pool-powerpc/main/l/linux/
> > >
> > > right now there are 6.12 and 6.13 kernels, but exact numbers probably will
> > > change.
> >
> > So does Linux boot now with SMP or only Mac OS?
>
> sadly, Linux still stuck on secondary cpu:
>
> ./qemu-system-ppc64 -M mac99,via=pmu -display sdl  -m 1024 -smp 2 -cpu
> G4 -hda DISK.qcow  -bios ~/K38_sdcard1/Documents/openbios-qemu-smp.elf
>  -accel tcg,thread=multi -kernel
> ~/K38_sdcard1/Documents/debian-ppc-smp/vmlinux-6.12.16-powerpc-smp
> -append "root=/dev/sda3" -nographic
>
>
> [...]
> [    0.000000] NR_IRQS: 512, nr_irqs: 512, preallocated irqs: 16
> [    0.000000] mpic: Setting up MPIC " MPIC 1   " version 1.2 at
> 80040000, max 2  CPUs
> [    0.000000] mpic: ISU size: 64, shift: 6, mask: 3f
> [    0.000000] mpic: Initializing for 64 sources
> [    0.000000] rcu: srcu_init: Setting srcu_struct sizes based on
> contention.
> [    0.000000] GMT Delta read from XPRAM: 0 minutes, DST: on
> [    0.001162] clocksource: timebase: mask: 0xffffffffffffffff
> max_cycles: 0x5c4 0939b5, max_idle_ns: 440795202646 ns
> [    0.002311] clocksource: timebase mult[28000000] shift[24] registered
> [...]
> smp_core99_probe
> [    0.202609] PowerMac SMP probe found 2 cpus
> [    0.204732] PMU i2c /pci@f2000000/mac-io@c/via-pmu@16000
> [    0.206320]  channel 1 bus <multibus>
> [    0.206580]  channel 2 bus <multibus>
> [    0.207625] Processor timebase sync using GPIO 0x73
> [    0.208058] mpic: requesting IPIs...
> [    0.209616] CPU0: L2CR is 0
> [    0.293368] rcu: Hierarchical SRCU implementation.
> [    0.293819] rcu:     Max phase no-delay instances is 1000.
> [    0.299338] Timer migration: 1 hierarchy levels; 8 children per
> group; 1 cros snode level
> [    0.328398] smp: Bringing up secondary CPUs ...
> smp_core99_kick_cpu
> smp_core99_kick_cpu done
> [   25.404555] Processor 1 is stuck.
> [   25.417223] smp: Brought up 1 node, 1 CPU
> [   25.438115] Memory: 1006996K/1048576K available (13208K kernel
> code, 1312K rw data, 7272K rodata, 1572K init, 489K bss, 37920K
> reserved, 0K cma-reserved, 2621 44K highmem)
>
> =======
>
> so sadly no Linux SMP yet. But at least it does no bomb in MMU setup?
>
> I used Howard's openbios binary for this experiment


apparently Debian 12 SID powerpc archive (to use in
/etc/apt/apt/sources.list) lives at

http://ftp.ports.debian.org/debian-ports/

Not sure if my install will survive "apt update" or not :)

I get vmlinux/inird file from unbootable installation by attaching
disk to amd6 qemu debian 11 VM,
and then rsync them out to 10.0.2.2 (host)

 ./qemu-system-ppc64 -M mac99,via=pmu -display sdl  -m 1024 -smp 2 -cpu
G4 -hda DISK.qcow  -bios ~/K38_sdcard1/Documents/openbios-qemu-smp.elf
 -accel tcg,thread=multi -kernel ~/boot/vmlinux-6.1.0-9-powerpc-smp
-initrd ~/boot/initrd.img-6.1.0-9-powerpc-smp  -append
"root=/dev/sda3"

this line started currently updating VM. One cpu on host seems to be
spinning at 100%, inside VM
cat /proc/cpuinfo only shows 1 cpu.

found interesting discussion from 2014, but it talks about ppc64 kernel on G5 ?

http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1419230320-37558-1-git-send-email-dongsheng.wang@freescale.com/

====
Kernel cannot bring up Non-boot cpus always get "Processor xx is stuck".
this issue bring by http://patchwork.ozlabs.org/patch/418912/ (powerpc:
Secondary CPUs must set cpu_callin_map after setting active and online)
We need to take timebase after bootup cpu give the timebase firstly.

When start_secondary, non-boot cpus set cpu_callin_map for boot cpu
after that boot cpu will give the timebase for non-boot cpu. Otherwise
non-boot cpus will fall in dead loop to waiting bootup cpu to give
imebase.


======







>
> Assuming Linux works on
> > real machine the emulation may still not be like real machine but it's
> > possible it works on real machine because it relies on some code or MMU
> > caching that happens on real CPU but is not emulated in QEMU. If that's
> > the case it can be argued if it's a bug in Linux or QEMU especially that
> > MacOS seems to cope with it so not sure we have to be concerned with that.
> >
> > Regards,
> > BALATON Zoltan

reply via email to

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