* Re: Does kvm_pr work on G5 mac with host kernel 6.12.xx ? [not found] ` <418f045e-7aaf-c48b-4f08-018625b2c3e6@eik.bme.hu> @ 2026-06-14 19:03 ` Andrew Randrianasulu 2026-06-14 20:35 ` BALATON Zoltan 0 siblings, 1 reply; 8+ messages in thread From: Andrew Randrianasulu @ 2026-06-14 19:03 UTC (permalink / raw) To: BALATON Zoltan; +Cc: qemu-ppc, linuxppc-dev [-- Attachment #1: Type: text/plain, Size: 4005 bytes --] вс, 14 июн. 2026 г., 17:29 BALATON Zoltan <balaton@eik.bme.hu>: > 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: > > 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? > 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 ? I am not ever sure firmware here can load 32bit ppc Linux .. I'll try of course. 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. > > 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 > Regards, > BALATON Zoltan > [-- Attachment #2: Type: text/html, Size: 6016 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Does kvm_pr work on G5 mac with host kernel 6.12.xx ? 2026-06-14 19:03 ` Does kvm_pr work on G5 mac with host kernel 6.12.xx ? Andrew Randrianasulu @ 2026-06-14 20:35 ` BALATON Zoltan 2026-06-15 9:26 ` Andrew Randrianasulu 0 siblings, 1 reply; 8+ messages in thread From: BALATON Zoltan @ 2026-06-14 20:35 UTC (permalink / raw) To: Andrew Randrianasulu; +Cc: qemu-ppc, linuxppc-dev [-- Attachment #1: Type: text/plain, Size: 5241 bytes --] On Sun, 14 Jun 2026, Andrew Randrianasulu wrote: > вс, 14 июн. 2026 г., 17:29 BALATON Zoltan <balaton@eik.bme.hu>: >> 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. 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. >> >> 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. Regards, BALATON Zoltan ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Does kvm_pr work on G5 mac with host kernel 6.12.xx ? 2026-06-14 20:35 ` BALATON Zoltan @ 2026-06-15 9:26 ` Andrew Randrianasulu 2026-06-15 13:33 ` BALATON Zoltan 2026-06-15 18:10 ` Christophe Leroy (CS GROUP) 0 siblings, 2 replies; 8+ messages in thread From: Andrew Randrianasulu @ 2026-06-15 9:26 UTC (permalink / raw) To: BALATON Zoltan; +Cc: qemu-ppc, linuxppc-dev [-- Attachment #1: Type: text/plain, Size: 9326 bytes --] вс, 14 июн. 2026 г., 23:35 BALATON Zoltan <balaton@eik.bme.hu>: > On Sun, 14 Jun 2026, Andrew Randrianasulu wrote: > > вс, 14 июн. 2026 г., 17:29 BALATON Zoltan <balaton@eik.bme.hu>: > >> 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 [-- Attachment #2: Type: text/html, Size: 13941 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Does kvm_pr work on G5 mac with host kernel 6.12.xx ? 2026-06-15 9:26 ` Andrew Randrianasulu @ 2026-06-15 13:33 ` BALATON Zoltan 2026-06-15 15:38 ` Andrew Randrianasulu 2026-06-15 18:12 ` Christophe Leroy (CS GROUP) 2026-06-15 18:10 ` Christophe Leroy (CS GROUP) 1 sibling, 2 replies; 8+ messages in thread From: BALATON Zoltan @ 2026-06-15 13:33 UTC (permalink / raw) To: Andrew Randrianasulu; +Cc: qemu-ppc, linuxppc-dev On Mon, 15 Jun 2026, Andrew Randrianasulu wrote: > 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! NIP=0x700 is illegal instruction exception due to trying to execute 0 opcode at 0x100 which is the reset vector but shouldn't it try to start at 0xfff00100? Maybe there's some issue with setting up KVM correctly? You can trace what is executed in TCG with -d in_asm but that does not work for KVM as it's a TCG debug option. I don't know how to trace execution with KVM but probably there are some trace points for that. Maybe you get some info with -trace enable="kvm*" but I don't know how to understand that output. Regards, BALATON Zoltan ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Does kvm_pr work on G5 mac with host kernel 6.12.xx ? 2026-06-15 13:33 ` BALATON Zoltan @ 2026-06-15 15:38 ` Andrew Randrianasulu 2026-06-15 18:12 ` Christophe Leroy (CS GROUP) 1 sibling, 0 replies; 8+ messages in thread From: Andrew Randrianasulu @ 2026-06-15 15:38 UTC (permalink / raw) To: BALATON Zoltan; +Cc: qemu-ppc, linuxppc-dev [-- Attachment #1: Type: text/plain, Size: 4862 bytes --] пн, 15 июн. 2026 г., 16:33 BALATON Zoltan <balaton@eik.bme.hu>: > On Mon, 15 Jun 2026, Andrew Randrianasulu wrote: > > 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! > > NIP=0x700 is illegal instruction exception due to trying to execute 0 > opcode at 0x100 which is the reset vector but shouldn't it try to start at > 0xfff00100? Maybe there's some issue with setting up KVM correctly? You > can trace what is executed in TCG with -d in_asm but that does not work > for KVM as it's a TCG debug option. I don't know how to trace execution > with KVM but probably there are some trace points for that. Maybe you get > some info with -trace enable="kvm*" but I don't know how to understand > that output. > -trace *kvm* (on qemu 6.1.1) ends with kvm_vcpu_ioctl cpu_index 0, type 0x8010aeac, arg 0xe81a8080 kvm_vcpu_ioctl cpu_index 0, type 0x8010aeac, arg 0xe81a8080 kvm_vcpu_ioctl cpu_index 0, type 0x8010aeac, arg 0xe81a8080 kvm_vcpu_ioctl cpu_index 0, type 0x8010aeac, arg 0xe81a8080 kvm_vcpu_ioctl cpu_index 0, type 0x84d0ae84, arg 0xe81a7b78 kvm_vcpu_ioctl cpu_index 0, type 0x8010aeac, arg 0xe81a8018 kvm_vcpu_ioctl cpu_index 0, type 0x8010aeac, arg 0xe81a8018 kvm_vcpu_ioctl cpu_index 0, type 0x8010aeac, arg 0xe81a8018 kvm_vcpu_ioctl cpu_index 0, type 0x8010aeac, arg 0xe81a8018 kvm_failed_spr_set Warning: Unable to set SPR 1013 to KVM: Invalid argument kvm_vcpu_ioctl cpu_index 0, type 0x2000ae80, arg (nil) kvm_vcpu_ioctl cpu_index 0, type 0x2000ae80, arg (nil) My hack idea about adding || defined CONFIG_PPC_BOOK3S_64 to two statement in arch/powerpc/kvm/emulate.c also did not improve situation :( but at least I know I am running with patched kvm_pr module because I commented this kernel printk about "failed to emulate instruction" and this line disappeared from dmesg. > Regards, > BALATON Zoltan > [-- Attachment #2: Type: text/html, Size: 6965 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Does kvm_pr work on G5 mac with host kernel 6.12.xx ? 2026-06-15 13:33 ` BALATON Zoltan 2026-06-15 15:38 ` Andrew Randrianasulu @ 2026-06-15 18:12 ` Christophe Leroy (CS GROUP) 2026-06-15 18:54 ` BALATON Zoltan 1 sibling, 1 reply; 8+ messages in thread From: Christophe Leroy (CS GROUP) @ 2026-06-15 18:12 UTC (permalink / raw) To: BALATON Zoltan, Andrew Randrianasulu; +Cc: qemu-ppc, linuxppc-dev Le 15/06/2026 à 15:33, BALATON Zoltan a écrit : > On Mon, 15 Jun 2026, Andrew Randrianasulu wrote: >> 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! > > NIP=0x700 is illegal instruction exception due to trying to execute 0 > opcode at 0x100 which is the reset vector but shouldn't it try to start > at 0xfff00100? Maybe there's some issue with setting up KVM correctly? On powerpc32 it is 0x100 or 0xfff00100 based on whether bit IP (Interrupt Prefix) is 0 or 1 in MSR register. On powerpc64 MSR[IP] doesn't exist. Christophe > You can trace what is executed in TCG with -d in_asm but that does not > work for KVM as it's a TCG debug option. I don't know how to trace > execution with KVM but probably there are some trace points for that. > Maybe you get some info with -trace enable="kvm*" but I don't know how > to understand that output. > > Regards, > BALATON Zoltan > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Does kvm_pr work on G5 mac with host kernel 6.12.xx ? 2026-06-15 18:12 ` Christophe Leroy (CS GROUP) @ 2026-06-15 18:54 ` BALATON Zoltan 0 siblings, 0 replies; 8+ messages in thread From: BALATON Zoltan @ 2026-06-15 18:54 UTC (permalink / raw) To: Christophe Leroy (CS GROUP); +Cc: Andrew Randrianasulu, qemu-ppc, linuxppc-dev On Mon, 15 Jun 2026, Christophe Leroy (CS GROUP) wrote: >> NIP=0x700 is illegal instruction exception due to trying to execute 0 >> opcode at 0x100 which is the reset vector but shouldn't it try to start at >> 0xfff00100? Maybe there's some issue with setting up KVM correctly? > > On powerpc32 it is 0x100 or 0xfff00100 based on whether bit IP (Interrupt > Prefix) is 0 or 1 in MSR register. > > On powerpc64 MSR[IP] doesn't exist. But this is under QEMU which sets in qemu/hw/ppc/mac_newworld.c: #define PROM_BASE 0xfff00000 [...] static void ppc_core99_reset(void *opaque) { PowerPCCPU *cpu = opaque; cpu_reset(CPU(cpu)); /* 970 CPUs want to get their initial IP as part of their boot protocol */ cpu->env.nip = PROM_BASE + 0x100; } So the execution should start from 0xfff00100 unconditionally where the OpenBIOS is loaded but I haven't seem the QEMU command so I'm only guessing this is with qemu-system-ppc -machine mac99,accel=kvm. I'm not sure how it got to 0x100 instead but there's no code there to execute on reset. Regards, BALATON Zoltan ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Does kvm_pr work on G5 mac with host kernel 6.12.xx ? 2026-06-15 9:26 ` Andrew Randrianasulu 2026-06-15 13:33 ` BALATON Zoltan @ 2026-06-15 18:10 ` Christophe Leroy (CS GROUP) 1 sibling, 0 replies; 8+ messages in thread From: Christophe Leroy (CS GROUP) @ 2026-06-15 18:10 UTC (permalink / raw) To: Andrew Randrianasulu, BALATON Zoltan; +Cc: qemu-ppc, linuxppc-dev Le 15/06/2026 à 11:26, Andrew Randrianasulu a écrit : > > > вс, 14 июн. 2026 г., 23:35 BALATON Zoltan <balaton@eik.bme.hu > <mailto:balaton@eik.bme.hu>>: [...] > > 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 <https:// > eur01.safelinks.protection.outlook.com/? > url=https%3A%2F%2Flkml.iu.edu%2F1605.1%2F03841.html&data=05%7C02%7Cchristophe.leroy2%40cs-soprasteria.com%7C5e49653ba80147cc12e808decac03273%7C8b87af7d86474dc78df45f69a2011bb5%7C0%7C0%7C639171124039051598%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=7gxjETKFSAMFjcnBQUuYcFHR2OE7b3W%2FGMRdHWF9X0Q%3D&reserved=0> > > 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 don't understand what you mean. CONFIG_PPC_BOOK3S is defined as: config PPC_BOOK3S def_bool y depends on PPC_BOOK3S_32 || PPC_BOOK3S_64 Christophe ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-06-15 22:29 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CA+rFky7UDpHYFXvEiq91dpnfLuKCiaONctmW-q2jONmNG25Wow@mail.gmail.com>
[not found] ` <418f045e-7aaf-c48b-4f08-018625b2c3e6@eik.bme.hu>
2026-06-14 19:03 ` Does kvm_pr work on G5 mac with host kernel 6.12.xx ? Andrew Randrianasulu
2026-06-14 20:35 ` BALATON Zoltan
2026-06-15 9:26 ` Andrew Randrianasulu
2026-06-15 13:33 ` BALATON Zoltan
2026-06-15 15:38 ` Andrew Randrianasulu
2026-06-15 18:12 ` Christophe Leroy (CS GROUP)
2026-06-15 18:54 ` BALATON Zoltan
2026-06-15 18:10 ` Christophe Leroy (CS GROUP)
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.