On Jan 21, 2018, at 7:36 AM, Segher Boessenkool <segher@kernel.crashing.org> wrote:

On Sun, Jan 21, 2018 at 09:29:18AM +0000, Mark Cave-Ayland wrote:
On 20/01/18 15:51, Segher Boessenkool wrote:
On Sat, Jan 20, 2018 at 09:38:21AM -0500, Jd Lyons via OpenBIOS wrote:
--- a/arch/ppc/qemu/init.c
+++ b/arch/ppc/qemu/init.c
@@ -550,6 +550,18 @@ static const struct cpudef ppc_defs[] = {
        .tlb_size = 0x80,
        .initfn = cpu_g4_init,
    },
+    .iu_version = 0x80030000,
+    .name = "PowerPC,G4",
+    .icache_size = 0x8000,
+    .dcache_size = 0x8000,
+    .icache_sets = 0x80,
+    .dcache_sets = 0x80,
+    .icache_block_size = 0x20,
+    .dcache_block_size = 0x20,
+    .tlb_sets = 0x40,
+    .tlb_size = 0x80,
+    .initfn = cpu_g4_init,
+},

These numbers are all correct (I checked against the manual).

Should there be something for L2 as well?

Good question - I suspect you're the best person to know here ;)  Could
not having the L2 properties cause strange behaviour, or will the guest
OS carry on fine without them present? (I presume this isn't a NACK?)

This isn't a NAK; the other CPUs are like that as well in the openbios
code I guess, and some of those have L2.

L2 is described in a node _under_ the "cpu" node in the device tree.
Linux does not care if it is absent; I don't know about the other OSes
though.  If everything works it is not a pressing concern ;-)


After installing Linux in the guest, no L2 cache is active, and you can really fell it as to how responsive the system is.

I don’t know if the L2 cache is emulated on the PPC CPU’s that Qemu support?

If it is, then we should add this to openbios, but if it isn’t, I don’t know if that would break things?

On a side note, investigating why BootX hangs when I try to boot OS X with -cpu host, it seem the bless command will create BootX and you can pass it a file to create a costume BootX from.

If anyone knows anything about this feature, please speak up.

Steve Smith created a version of BootX to get Mac OS Sever v1.2 booting in Qemu-PPC, and it has some logging features, but it doesn’t work with kernels passed OS X 10.1. I tried to boot the 10.1 CD with it, with -cpu host, but it doesn’t give me any useful info.

https://github.com/steventroughtonsmith/bootx

bless —help 
--bootinfo [file] Use <file> to create a "BootX" file in the
blessed dir

Mark, I’ll look over the info you posted and see if I can figure the proper way to submit a patch. I’m having trouble with my email clients on the old PPC machines, and yahoo doesn’t want to play nice. 

My patch to Qemu is incomplete, seems the cpu I added doesn’t get added to the cpu info list when you invoke —cpu help, and you can’t specify it with -cpu 7447a_v1.5.

It’s a bit of a leaning curve for me, but I’ll figure all the proper ways to do this stuff.

Hoping we can add some more features to openbios and qemu-ppc as I’ll have quite a few old Macs to help.




Segher

--
OpenBIOS                 http://openbios.org/
Mailinglist:  http://lists.openbios.org/mailman/listinfo
Free your System - May the Forth be with you