LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: BALATON Zoltan <balaton@eik.bme.hu>
To: Andrew Randrianasulu <randrianasulu@gmail.com>
Cc: qemu-ppc@nongnu.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: Does kvm_pr work on G5 mac with host kernel 6.12.xx ?
Date: Sun, 14 Jun 2026 22:35:33 +0200 (CEST)	[thread overview]
Message-ID: <fb610033-efd3-6fa6-bd80-c5dccc9296eb@eik.bme.hu> (raw)
In-Reply-To: <CA+rFky73KGYwJRBuEBqFA1dKkDk0_W+u4VQL9bg2n1_AkeOU3g@mail.gmail.com>

[-- 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

  reply	other threads:[~2026-06-15  4:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
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)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fb610033-efd3-6fa6-bd80-c5dccc9296eb@eik.bme.hu \
    --to=balaton@eik.bme.hu \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=randrianasulu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox