qemu-ppc
[Top][All Lists]
Advanced

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

Re: roms/SLOF: crashes on G5 (970) with newer pseries


From: David Gibson
Subject: Re: roms/SLOF: crashes on G5 (970) with newer pseries
Date: Mon, 19 Apr 2021 13:19:48 +1000

On Mon, Apr 12, 2021 at 09:42:23AM -0700, Jake Hamby wrote:
> I've been testing QEMU + KVM-PR on a Power Mac G5 Quad, and it runs
> better than I expected, but with a few glitches. The first one I
> discovered: the SLOF ROM has been compiled for POWER7 or newer, and it
> crashes when run on a G5 (KVM and TCG) if the pseries version is set
> to 2.6 or higher. The xHCI SLOF driver crashes the guest with
> pseries-2.6, and it doesn't even get to initializing the screen with
> higher versions.
> 
> Fortunately, it was a small change to recompile SLOF from source with
> the target set to "ppc970" instead of "ppcp7". I had to fix a few

> build errors first. Commit link (I would paste the patches inline, but
> I don't have Gmail set up for that yet):
> 
> https://github.com/jhamby/SLOF/commit/4ae9a012a2cec4a1b476c1b4a3933def5ae36f2b
> 
> And my commit to change the default QEMU board type to ppc970:
> 
> https://github.com/jhamby/SLOF/commit/619539cfa3a37f9527ae382cdb7573de7fa6d836
> 
> With these changes, the compiled slof.bin works perfectly for me with
> pseries versions up to 4.2 (the highest version I tried that doesn't
> expect CPU capabilities that the G5 doesn't have) and the 970mp CPU
> type (with both KVM-PR and TCG).
> 
> I don't know if there are any negative performance implications of
> compiling SLOF for PPC 970 and using it with later CPU types, but I'm
> guessing that PowerNV is the preferred machine type for POWER8 and
> newer now. It does feel like a bug that the SLOF ROM crashes
> unexpectedly with older CPU models in legal machine configurations.

"Legal" is really pushing it.  SLOF is only used for the "pseries"
machine type, which is PAPR based.  Running a PAPR guest on 970 is
pretty dubious: you're talking a POWER4 era guest to begin with, and
IIRC in POWER4 days PAPR virtualization worked differently than it
does now, which I don't think we ever supported in qemu and I'm not
sure we still do in the kernel.

KVM PR supports the guest cpu being different from the host.
Generally it's only handling differences in privileged mode
instructions, which I suspect isn't the problem here.  I think a more
productive approach might be to teach KVM PR to trap and emulate the
missing POWER7 instructions, so that it can support a POWER7 guest on
a 970 host.

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature


reply via email to

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