вс, 14 июн. 2026 г., 23:35 BALATON Zoltan <[email protected]>:

> On Sun, 14 Jun 2026, Andrew Randrianasulu wrote:
> > вс, 14 июн. 2026 г., 17:29 BALATON Zoltan <[email protected]>:
> >> On Sun, 14 Jun 2026, Andrew Randrianasulu wrote:
> >>> I tried qemu 10.0.10 (qemu-system-ppc) compiled as ppc32 binary - fail
> >>>
> >>> I tried qemu 2.2.0 compiled as ppc64 binary (qemu-system-ppc and ppc64
> >>> variants) -fail
> >>>
> >>> I tried qemu 5.0.0 compiled as 32bit ppc (qemu-system-ppc) - fail.
> >>>
> >>> I tried qemu 6.1.1 compiled as 32bit ppc binary - qemu-system-ppc.
> Fail.
> >>>
> >>> I tried recompiling host kernel without preemtion - still fail.
> >>>
> >>> :(
> >>>
> >>> fail like this in dmesg
> >>>
> >>> [75573.287328] Couldn't emulate instruction 0x00000000 (op 0 xop 0)
> >>>                        [75573.287334] kvmppc_exit_pr_progint: emulation
> >> at
> >>> 100 failed (00000000)
> >>>
> >>>
> >>> lscpu output:
> >>> Architecture:                ppc64
> >>>
> >>> CPU op-mode(s):            32-bit, 64-bit
> >>> Byte Order:                Big Endian
> >>> CPU(s):                      2
> >>>
> >>> On-line CPU(s) list:       0,1
> >>>
> >>> Model name:                  PPC970MP, altivec supported
> >>> Model:                     1.1 (pvr 0044 0101)
> >> [...]
> >>> Why so old qemu? Well, it worked on OSX Leopard 10.5.8 on same machine,
> >> so
> >>> I compiled it as 64bit ppc64 binary - new qemu grow a lot  ... and
> >> keeping
> >>> effectively 3 different dev systems makes this 160 gb hdd look small :)
> >>
> >> I don't know about it but I think the only combination that ever worked
> >> was ppc on ppc (i.e. KVM on G4 Macs) or maybe ppc64 on ppc64. Running
> ppc
> >> on ppc64 is known not to work and I haven't heard about anybody fixing
> >> that. There was a blog entry about running MacOS on Power10:
>
> Actually I meant POWER9 not POWER10.
>
> >>
> https://www.talospace.com/2018/08/making-your-talos-ii-into-power-mac_29.html
> >> but I think that was on ppc64le (which does not work on G5 as that's big
> >> endian only) and you still needed a guest kernel that could handle the
> G5
> >> due to different cache line size that affects at least dcbz which is
> used
> >> to clear memory so unless that's correctly emulated by KVM it may clear
> >> more bytes than intended and break.
> >>
> >
> > https://forum.hyperion-entertainment.com/viewtopic.php?t=4736&start=1410
> >
> > I thought this picture showed ppc64 kernel at host (not mac, neo amiga)
> and
> > qemu-system-ppc with non-obvious bitness?
>
> But that's BookE e500 not the BookS POWER4 variant G5 you have so KVM may
> work differently on that and maybe it even has HV which probably works
> better than PR.


oh yes, I noticed another "hidden" option in Kconfig about kvm pr on
E5500/E6500

It was hidden because I did not select such machine in config, I guess.


I think KVM was used on G4, e500 and newer POWER mostly
> with HV but I'm not sure if KVM PR on G5 was ever well supported. Did you
> try running the same Linux version that you have on your host under KVM PR
> first to verify that at least that works? I think that's where everybody
> should start with KVM before trying to boot other guest OSes.
>
> >> So considering the above, what may work is if you run a 32 bit ppc
> kernel
> >> (G4 version) on your G5 for the host not using it as 64 bit instead of
> >> ppc64 kernel and try a guest kernel that detects G5 CPU and knows how to
> >> handle the different cache line size.
> >
> >
> > Are you saying 32bit *Linux* ppc kvm as host can handle 64bit guest
> kernel ?
>
> No I meant trying a 32 bit host with 32 bit guest but the cache line size
> issue may still get in the way so maybe this does not help but for
> debugging may worth a try.
>
> > I am not ever sure firmware here can load 32bit ppc Linux .. I'll try of
> > course.
>
> Since G5 is backwards compatible with PPC32 maybe it should work but I
> know nothing about real PowerPC machines.
>
> > Or find and fix the emulation of
> >> different instructions on ppc64 in Linux KVM when running 32 bit ppc
> code
> >> on 64 but host. There supposed to be some support for that but maybe
> it's
> >> broken or never finished.
>

I found this email msg today:


https://lkml.iu.edu/1605.1/03841.html

checked

linux-6.12.92/arch/powerpc/kvm/emulate.c and there seems to be ifdef only
for

#ifdef CONFIG_PPC_BOOK3S
                       kvmppc_core_queue_program(vcpu, SRR1_PROGTRAP);

#else
                        kvmppc_core_queue_program(vcpu,
                        arch.shared->esr | ESR_PTR);

#endif


may be this ifdef should include CONFIG_PPC_BOOK3S_64 as well ?

I also tried to see "info registers" as you showed in another email from
2021 where you tried to use kvm-pr on qemu-emulated G5 and it showed

info registers
                NIP 0000000000000700   LR 0000000000000000 CTR
0000000000000000 XER 0000000000000000 CPU#0
MSR 8000000000000000 HID0 0000000060000000  HF 8000000000000000 iidx 3 didx
3                      TB 00000000 00000000 DECR 0
                                              GPR00 0000000000000000
0000000000000000 0000000000000000 0000000000000000
GPR04 0000000000000000 0000000000000000 0000000000000000 0000000000000000
                        GPR08 0000000000000000 0000000000000000
0000000000000000 0000000000000000                          GPR12
0000000000000000 0000000000000000 0000000000000000 0000000000000000
GPR16 0000000000000000 0000000000000000 0000000000000000 0000000000000000
                        GPR20 0000000000000000 0000000000000000
0000000000000000 0000000000000000                          GPR24
0000000000000000 0000000000000000 0000000000000000 0000000000000000
                  GPR28 0000000000000000 0000000000000000 0000000000000000
0000000000000000
CR 00000000  [ -  -  -  -  -  -  -  -  ]             RES ffffffffffffffff
                        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 0000000000000000
                        SRR0 0000000000000100  SRR1 8000000000080000    PVR
00000000003c0301 VRSAVE 0000000000000000      SPRG0 0000000000000000 SPRG1
0000000000000000  SPRG2 0000000000000000  SPRG3 0000000000000000      SPRG4
0000000000000000 SPRG5 0000000000000000  SPRG6 0000000000000000  SPRG7
0000000000000000
 SDR1 0000000000000000   DAR 0000000000000000  DSISR 0000000000000000

(qemu) q

not sure if instruction pointer moved or not ...

looking at some scroll buffer in Termux (I ssh into powermac ) it was at
700 all 3 times I typed "info registers" into qemu monitor.

but this debug msg

[154992.595845] Couldn't emulate instruction 0x00000000 (op 0 xop 0)
[154992.595859] kvmppc_exit_pr_progint: emulation at 100 failed (00000000)


fills logs FAST!


>>
> >> But as I said I don't know this and don't have PPC hardware to try, nor
> >> interest to do it so it's just my understanding and guess, which may be
> >> wrong, but that's probably where you should start looking. Hopefully
> there
> >> are others here with more knowledge about it or who want to look at it.
> >> You should also look at how to enable KVM debug logs in Linux kernel and
> >> see if you get any errors in the syslog. The usual QEMU debug options
> are
> >> not that helpful with KVM and you should look for KVM logs instead.
> >>
> >
> > In theory I subscribed to linux-ppc (kernel) list. May be I should cc
> them
> > ? (added to cc)
> >
> > I tried kvm-unit-tests but they apparently require qemu (to my surprise!)
> > and mostly focus on pseries / kvm HV (not surprisingly)?
> >
> > Is there anything smaller to test kvm_pr specifically?
> >
> > I even tried to d/l svn version of Mac on Linux but this one failed to
> > compile with gcc 15.
> >
> > svn checkout svn://svn.code.sf.net/p/mac-on-linux/code/trunk
> > mac-on-linux-code
>
> I think you may have better luck trying an older Linux distro from the
> time this was still used and had MoL as a package as that may have been
> tested back then on real machines and used to work. Anything newer is
> likely untested and thus could be broken without anybody noticing and
> fixing it so finding something older that worked at least would give a
> baseline to find regressions against.
>


Yeah, it will require some work/time on my end.

If simple hack like adding ifdef case as I speculated above will not work
.. will try harder  route  : )

>
> Regards,
> BALATON Zoltan

Reply via email to