qemu-ppc
[Top][All Lists]
Advanced

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

Re: OpenMPIC controller emulation in qemu ?


From: Andrew Randrianasulu
Subject: Re: OpenMPIC controller emulation in qemu ?
Date: Sat, 18 May 2024 21:06:16 +0300



On Sat, May 18, 2024 at 12:39 PM BALATON Zoltan <balaton@eik.bme.hu> wrote:
On Sat, 18 May 2024, Andrew Randrianasulu wrote:
> yeah. I  modified openbios like this:
>
> bash-5.1$ cat /dev/shm/new_smp_openbios.txt
> diff --git a/arch/ppc/qemu/init.c b/arch/ppc/qemu/init.c
> index 253394c..7b7b09d 100644
> --- a/arch/ppc/qemu/init.c
> +++ b/arch/ppc/qemu/init.c
> @@ -348,8 +348,9 @@ cpu_add_pir_property(void)
>     unsigned long pir;
>
>     asm("mfspr %0, 1023\n"
> -        : "=r"(pir) :);
> +        : "=r"(pir) :);;
>     PUSH(pir);
> +    printk("Pir = %lu \n", pir);
>     fword("encode-int");
>     push_str("reg");
>     fword("property");
> @@ -381,9 +382,9 @@ static void
> cpu_g4_init(const struct cpudef *cpu)
> {
>     cpu_generic_init(cpu);
> -    cpu_add_pir_property();
> +        //cpu_add_pir_property();
>
> -    fword("finish-device");
> +    //fword("finish-device");
> }
>
> #ifdef CONFIG_PPC_64BITSUPPORT
> @@ -1073,13 +1074,23 @@ arch_of_init(void)
>     push_str("reg");
>     fword("property");
>
> +    int i;
> +
> +    for (i= 0; i<temp; i++) {
>     cpu = id_cpu();
>     cpu->initfn(cpu);
> -    printk("CPU type %s\n", cpu->name);
>
> -    snprintf(buf, sizeof(buf), "/cpus/%s", cpu->name);
> +    printk("CPU type %s\n", cpu->name);
> +        snprintf(buf, sizeof(buf), "/cpus/%s", cpu->name);
> +    PUSH(i);
> +        fword("encode-int");
> +        push_str("reg");
> +        fword("property");
> +        fword("finish-device");
> +    }
>     ofmem_register(find_dev("/memory"), find_dev(buf));
>     node_methods_init(buf);
> +
>
> #ifdef CONFIG_RTAS
>     /* OldWorld Macs don't have an /rtas node. */
> bash-5.1$

OK this could be cleaned up but for testing will do and shows the idea.

> and now it prints devices correctly in openfirmware!
>
> /dev/shm/qemu-9.0.0/build/qemu-system-ppc -m 512 -M mac99 -smp 4 -nographic
> -bios /dev/shm/openbios-qemu.elf

Forget about -smp 4 for now as no real G4 existed with more than 2 CPUs so
you're testing an non-existent setup that could lead to additional
problems so better just stick to -smp 2 first and make that work before
trying more CPUs.

>>> =============================================================
>>> OpenBIOS 1.1 [May 17 2024 14:27]
>>> Configuration device id QEMU version 1 machine id 1
>>> CPUs: 4
>>> Memory: 512M
>>> UUID: 00000000-0000-0000-0000-000000000000
>>> CPU type PowerPC,G4
>>> CPU type PowerPC,G4
>>> CPU type PowerPC,G4
>>> CPU type PowerPC,G4
> milliseconds isn't unique.
> Welcome to OpenBIOS v1.1 built on May 17 2024 14:27
> Trying hd:,\\:tbxi...
> Trying hd:,\ppc\bootinfo.txt...
> Trying hd:,%BOOT...
> No valid state has been set by load or init-program
>
> 0 > show-devs
> fff56d28 / (bootrom)
> fff56e44 /aliases
> fff56ee8 /openprom (BootROM)
> fff5d110 /openprom/client-services
> fff57090 /options
> fff57108 /chosen
> fff571b8 /builtin
> fff5725c /builtin/console
> fff5ce1c /packages
> fff5e000 /packages/cmdline
> fff5e140 /packages/disk-label
> fff5fe64 /packages/terminal-emulator
> fff60ed0 /packages/deblocker
> fff61224 /packages/hfsplus-files
> fff615b0 /packages/hfs-files
> fff61938 /packages/ext2-files
> fff61c5c /packages/iso9660-files
> fff61f80 /packages/grubfs-files
> fff622a4 /packages/mac-parts
> fff62608 /packages/pc-parts
> fff62928 /packages/xcoff-loader
> fff629f4 /packages/elf-loader
> fff62abc /packages/bootinfo-loader
> fff5fb8c /cpus
> fff6bdf8 /cpus/PowerPC,G4@0 (cpu)
> fff6c0ac /cpus/PowerPC,G4@1 (cpu)
> fff6c360 /cpus/PowerPC,G4@2 (cpu)
> fff6c614 /cpus/PowerPC,G4@3 (cpu)
> fff5fc8c /memory@0 (memory)
> fff5fd54 /rom@ff800000
> fff62be8 /nvram@fff04000 (nvram)
> fff62e80 /pci@f2000000 (pci)
> fff633a8 /pci@f2000000/mac-io@c (mac-io)
> fff63868 /pci@f2000000/mac-io@c/via-cuda@16000 (via-cuda)
> fff63a88 /pci@f2000000/mac-io@c/via-cuda@16000/adb (adb)
> fff63bf0 /pci@f2000000/mac-io@c/via-cuda@16000/adb/keyboard@8 (keyboard)
> fff63dcc /pci@f2000000/mac-io@c/via-cuda@16000/adb/mouse@9 (mouse)
> fff63f58 /pci@f2000000/mac-io@c/via-cuda@16000/rtc (rtc)
> fff640e8 /pci@f2000000/mac-io@c/via-cuda@16000/power-mgt (power-mgt)
> fff642d0 /pci@f2000000/mac-io@c/escc@13000 (escc)
> fff643f0 /pci@f2000000/mac-io@c/escc@13000/ch-a@13020 (serial)
> fff64648 /pci@f2000000/mac-io@c/escc@13000/ch-b@13000 (serial)
> fff64910 /pci@f2000000/mac-io@c/escc-legacy@12000 (escc-legacy)
> fff64a34 /pci@f2000000/mac-io@c/escc-legacy@12000/ch-a@12002 (serial)
> fff64c50 /pci@f2000000/mac-io@c/escc-legacy@12000/ch-b@12000 (serial)
> fff64edc /pci@f2000000/mac-io@c/ata-3@20000 (ata)
> fff652ac /pci@f2000000/mac-io@c/ata-3@21000 (ata)
> fff6567c /pci@f2000000/mac-io@c/ata-3@21000/cdrom@0 (block)
> fff65b18 /pci@f2000000/mac-io@c/interrupt-controller@40000 (open-pic)
> fff65d68 /pci@f2000000/usb@d (usb)
> fff660b4 /pci@f2000000/QEMU,VGA@e (display)
> fff6b688 /pci@f2000000/ethernet@f (network)
> fff6bc0c /uni-n@f8000000 (memory-controller)
> ok
> 0 >
>
> void ppc Kernel also boot further:
>
> Quiescing Open Firmware ...
>>> of_client_interface: quiesce
>>> of_client_interface return:
> Booting Linux via __start() @ 0x01000000 ...
> Hello World !
> [    0.000000] Total memory = 512MB; using 1024kB for hash table
> [    0.000000] Activating Kernel Userspace Execution Prevention
> [    0.000000] Activating Kernel Userspace Access Protection
> [    0.000000] Linux version 5.13.12_1 (voidlinux@voidlinux) (gcc (GCC)
> 10.2.1 20201203, GNU ld (GNU Binutils) 2.35.1) #1 SMP Thu Aug 19 14:12:26
> UTC 2021
> [    0.000000] ioremap() called early from pmac_feature_init+0xd4/0xad4.
> Use early_ioremap() instead
> [    0.000000] Found UniNorth memory controller & host bridge @ 0xf8000000
> revision: 0x07
> [    0.000000] Mapped at 0xf73c0000
> [    0.000000] ioremap() called early from probe_one_macio+0x17c/0x2b4. Use
> early_ioremap() instead
> [    0.000000] Found a Keylargo mac-io controller, rev: 0, mapped at
> 0x(ptrval)
> [    0.000000] PowerMac motherboard: PowerMac G4 AGP Graphics
> [    0.000000] ioremap() called early from udbg_scc_init+0x1e4/0x3f8. Use
> early_ioremap() instead
> [    0.000000] boot stdout isn't a display !
> [    0.000000] ioremap() called early from find_via_cuda+0xb4/0x404. Use
> early_ioremap() instead
> [    0.000000] Using PowerMac machine description
> [    0.000000] printk: bootconsole [udbg0] enabled
> [    0.000000] CPU maps initialized for 1 thread per core
> [    0.000000] -----------------------------------------------------
> [    0.000000] phys_mem_size     = 0x20000000
> [    0.000000] dcache_bsize      = 0x20
> [    0.000000] icache_bsize      = 0x20
> [    0.000000] cpu_features      = 0x000000000501a00a
> [    0.000000]   possible        = 0x00000000277de14a
> [    0.000000]   always          = 0x0000000001000000
> [    0.000000] cpu_user_features = 0x9c000001 0x00000000
> [    0.000000] mmu_features      = 0x00000001
> [    0.000000] Hash_size         = 0x100000
> [    0.000000] Hash_mask         = 0x3fff
> [    0.000000] -----------------------------------------------------
> [    0.000000] ioremap() called early from pmac_setup_arch+0x118/0x290. Use
> early_ioremap() instead
> [    0.000000] ioremap() called early from pmac_nvram_init+0x150/0x53c. Use
> early_ioremap() instead
> [    0.000000] nvram: Checking bank 0...
> [    0.000000] Invalid signature
> [    0.000000] Invalid checksum
> [    0.000000] nvram: gen0=0, gen1=0
> [    0.000000] nvram: Active bank is: 0
> [    0.000000] nvram: OF partition at 0xffffffff
> [    0.000000] nvram: XP partition at 0xffffffff
> [    0.000000] nvram: NR partition at 0xffffffff
> [    0.000000] Zone ranges:
> [    0.000000]   DMA      [mem 0x0000000000000000-0x000000001fffffff]
> [    0.000000]   Normal   empty
> [    0.000000]   HighMem  empty
> [    0.000000] Movable zone start for each node
> [    0.000000] Early memory node ranges
> [    0.000000]   node   0: [mem 0x0000000000000000-0x000000001fffffff]
> [    0.000000] Initmem setup node 0 [mem
> 0x0000000000000000-0x000000001fffffff]
> [    0.000000] percpu: Embedded 22 pages/cpu s59884 r8192 d22036 u90112
> [    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 129920
> [    0.000000] Kernel command line: console=ttyPZ0
> [    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144
> bytes, linear)
> [    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072
> bytes, linear)
> [    0.000000] mem auto-init: stack:off, heap alloc:on, heap free:off
> [    0.000000] Kernel virtual memory layout:
> [    0.000000]   * 0xf7bdf000..0xfffff000  : fixmap
> [    0.000000]   * 0xf7400000..0xf7800000  : highmem PTEs
> [    0.000000]   * 0xf7338000..0xf7400000  : early ioremap
> [    0.000000]   * 0xe1000000..0xf7338000  : vmalloc & ioremap
> [    0.000000] Memory: 500988K/524288K available (10912K kernel code, 1444K
> rwdata, 2512K rodata, 1420K init, 516K bss, 23300K reserved, 0K
> cma-reserved, 0K highmem)
> [    0.000000] random: get_random_u32 called from
> __kmem_cache_create+0x38/0x57c with crng_init=0
> [    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
> [    0.000000] ftrace: allocating 29527 entries in 87 pages
> [    0.000000] ftrace: allocated 87 pages with 5 groups
> [    0.000000] rcu: Hierarchical RCU implementation.
> [    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=2048 to
> nr_cpu_ids=4.
> [    0.000000]  Trampoline variant of Tasks RCU enabled.
> [    0.000000]  Rude variant of Tasks RCU enabled.
> [    0.000000]  Tracing variant of Tasks RCU enabled.
> [    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is
> 25 jiffies.
> [    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
> [    0.000000] NR_IRQS: 512, nr_irqs: 512, preallocated irqs: 16
> [    0.000000] mpic: Setting up MPIC " MPIC 1   " version 1.2 at 80040000,
> max 4 CPUs
> [    0.000000] mpic: ISU size: 68, shift: 7, mask: 7f
> [    0.000000] mpic: Initializing for 68 sources
> [    0.000000] GMT Delta read from XPRAM: 0 minutes, DST: on
> [    0.001126] clocksource: timebase: mask: 0xffffffffffffffff max_cycles:
> 0x5c40939b5, max_idle_ns: 440795202646 ns
> [    0.002717] clocksource: timebase mult[28000000] shift[24] registered
> [    0.259907] Console: colour dummy device 80x25
> [    2.664336] printk: console [ttyPZ0] enabled
> [    2.664336] printk: console [ttyPZ0] enabled
> [    2.665884] printk: bootconsole [udbg0] disabled
> [    2.665884] printk: bootconsole [udbg0] disabled
> [    2.668399] pid_max: default: 32768 minimum: 301
> [    2.962041] LSM: Security Framework initializing
> [    2.964621] Yama: becoming mindful.
> [    3.263901] AppArmor: AppArmor initialized
> [    3.561829] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes,
> linear)
> [    3.563098] Mountpoint-cache hash table entries: 1024 (order: 0, 4096
> bytes, linear)
> smp_core99_probe
> [    7.165726] PowerMac SMP probe found 4 cpus
> [    7.464725] Processor timebase sync using GPIO 0x73
> [    7.465420] mpic: requesting IPIs...
> [    7.765010] CPU0: L2CR is 0
> [    8.072220] rcu: Hierarchical SRCU implementation.
> [    8.375352] smp: Bringing up secondary CPUs ...
> smp_core99_kick_cpu
> smp_core99_kick_cpu done
> QEMU: Terminated
>
> so, progress! Note that mpic  shows correct n. of supported cpus too!

Looks like it reached the point where it tries to start addirional CPUs
but probably we need something for it to work. Now it's important to use a
kernel that works on real machine because there are some reports of
problems with some kernels:

https://lkml.iu.edu/hypermail/linux/kernel/0110.3/1786.html
http://lists.fixstars.com/yellowdog-general/October01/0545.html

You could try to find logs from real machine that shows what should it
look like and compare to what you get on QEMU. From the messages above and
the source around smp_core99_kick_cpu in Linux kernel I think it might try
to reset secondary CPU and get it start running some code. We may be
missing two things:

1. Modify QEMU mac_newworld.c to register different reset routine for CPUs
>= 1 that puts the CPU in HALT exception so it does not run until Linux
starts it.
2. Find out how resetting secondary CPUs work. The above message talks
about some Keylargo GPIO so it may need to be emulated and connected to
something to do a reset on the secondary CPU (this may be the reason why
more than two CPUs won't work when there's no way to connect them but I
don't know how it works just guess the hardware may have some limitations
as it wasn't designed for more than 2 CPUs).

> Also, i modded my line setting
>
> env->spr_cb[SPR_PIR].default_value  = i + 15;
>
> and "15" showed up in openfirmware startup before I commented it out for my
> hack. so, this part of qemu works,
> just no idea how to force openfirmware to probe all cpus for this reg in
> turn? ofcourse if fw will start with only one active cpu it can't

I think the above is enough information for Mark to find a way to fix it
in OpenBIOS so you could go on and try to find out what else is needed in
QEMU for it to get further and run the second CPU.

> as far as I understand e500 machine driven by uboot, not OpenFirmware ?

Yes, but that does not matter for how the CPUs are init by Linux. The
Linux doc said and the logs seems to confirm that it should start running
with CPU0 with other CPUs in halt then it will kick the secondary CPU out
of halt by a reset after setting the reset vector to code for that CPU. If
currently QEMU just starts all CPUs with OpenBIOS and OpenBIOS has nothing
to detect that and halt the additional CPUs then it may run the kernel on
all CPUs and may also miss the emulation of the mechanism to reset
secondaty CPU so it can't get it to start the code intended for it and
gets stuck at that point.

Using attached patch I get this  new dmesg:

Quiescing Open Firmware ...
>> of_client_interface: quiesce
>> of_client_interface return:
Booting Linux via __start() @ 0x01000000 ...
Hello World !
[    0.000000] Total memory = 512MB; using 1024kB for hash table
[    0.000000] Activating Kernel Userspace Execution Prevention
[    0.000000] Activating Kernel Userspace Access Protection
[    0.000000] Linux version 5.13.12_1 (voidlinux@voidlinux) (gcc (GCC) 10.2.1 20201203, GNU ld (GNU Binutils) 2.35.1) #1 SMP Thu Aug 19 14:12:26 UTC 2021
[    0.000000] ioremap() called early from pmac_feature_init+0xd4/0xad4. Use early_ioremap() instead
[    0.000000] Found UniNorth memory controller & host bridge @ 0xf8000000 revision: 0x07
[    0.000000] Mapped at 0xf73c0000
[    0.000000] ioremap() called early from probe_one_macio+0x17c/0x2b4. Use early_ioremap() instead
[    0.000000] Found a Keylargo mac-io controller, rev: 0, mapped at 0x(ptrval)
[    0.000000] PowerMac motherboard: PowerMac G4 AGP Graphics
[    0.000000] ioremap() called early from udbg_scc_init+0x1e4/0x3f8. Use early_ioremap() instead
[    0.000000] boot stdout isn't a display !
[    0.000000] ioremap() called early from find_via_cuda+0xb4/0x404. Use early_ioremap() instead
[    0.000000] Using PowerMac machine description
[    0.000000] printk: bootconsole [udbg0] enabled
[    0.000000] CPU maps initialized for 1 thread per core
[    0.000000] -----------------------------------------------------
[    0.000000] phys_mem_size     = 0x20000000
[    0.000000] dcache_bsize      = 0x20
[    0.000000] icache_bsize      = 0x20
[    0.000000] cpu_features      = 0x000000000501a00a
[    0.000000]   possible        = 0x00000000277de14a
[    0.000000]   always          = 0x0000000001000000
[    0.000000] cpu_user_features = 0x9c000001 0x00000000
[    0.000000] mmu_features      = 0x00000001
[    0.000000] Hash_size         = 0x100000
[    0.000000] Hash_mask         = 0x3fff
[    0.000000] -----------------------------------------------------
[    0.000000] ioremap() called early from pmac_setup_arch+0x118/0x290. Use early_ioremap() instead
[    0.000000] ioremap() called early from pmac_nvram_init+0x150/0x53c. Use early_ioremap() instead
[    0.000000] nvram: Checking bank 0...
[    0.000000] Invalid signature
[    0.000000] Invalid checksum
[    0.000000] nvram: gen0=0, gen1=0
[    0.000000] nvram: Active bank is: 0
[    0.000000] nvram: OF partition at 0xffffffff
[    0.000000] nvram: XP partition at 0xffffffff
[    0.000000] nvram: NR partition at 0xffffffff
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000000000000-0x000000001fffffff]
[    0.000000]   Normal   empty
[    0.000000]   HighMem  empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000001fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000001fffffff]
[    0.000000] percpu: Embedded 22 pages/cpu s59884 r8192 d22036 u90112
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 129920
[    0.000000] Kernel command line: console=ttyPZ0
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:on, heap free:off
[    0.000000] Kernel virtual memory layout:
[    0.000000]   * 0xf7bdf000..0xfffff000  : fixmap
[    0.000000]   * 0xf7400000..0xf7800000  : highmem PTEs
[    0.000000]   * 0xf7338000..0xf7400000  : early ioremap
[    0.000000]   * 0xe1000000..0xf7338000  : vmalloc & ioremap
[    0.000000] Memory: 500988K/524288K available (10912K kernel code, 1444K rwdata, 2512K rodata, 1420K init, 516K bss, 23300K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] random: get_random_u32 called from __kmem_cache_create+0x38/0x57c with crng_init=0
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] ftrace: allocating 29527 entries in 87 pages
[    0.000000] ftrace: allocated 87 pages with 5 groups
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=2048 to nr_cpu_ids=4.
[    0.000000]  Trampoline variant of Tasks RCU enabled.
[    0.000000]  Rude variant of Tasks RCU enabled.
[    0.000000]  Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 512, nr_irqs: 512, preallocated irqs: 16
[    0.000000] mpic: Setting up MPIC " MPIC 1   " version 1.2 at 80040000, max 4 CPUs
[    0.000000] mpic: ISU size: 64, shift: 6, mask: 3f
[    0.000000] mpic: Initializing for 64 sources
[    0.000000] GMT Delta read from XPRAM: 0 minutes, DST: on
[    0.001114] clocksource: timebase: mask: 0xffffffffffffffff max_cycles: 0x5c40939b5, max_idle_ns: 440795202646 ns
[    0.002661] clocksource: timebase mult[28000000] shift[24] registered
[    0.022081] Console: colour dummy device 80x25
[    0.059474] printk: console [ttyPZ0] enabled
[    0.059474] printk: console [ttyPZ0] enabled
[    0.060950] printk: bootconsole [udbg0] disabled
[    0.060950] printk: bootconsole [udbg0] disabled
[    0.063583] pid_max: default: 32768 minimum: 301
[    0.066030] LSM: Security Framework initializing
[    0.068483] Yama: becoming mindful.
[    0.075446] AppArmor: AppArmor initialized
[    0.076811] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.077566] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
smp_core99_probe
[    0.140858] PowerMac SMP probe found 4 cpus
[    0.142883] Processor timebase sync using GPIO 0x73
[    0.143474] mpic: requesting IPIs...
[    0.148795] CPU0: L2CR is 0
[    0.164657] rcu: Hierarchical SRCU implementation.
[    0.186502] smp: Bringing up secondary CPUs ...
smp_core99_kick_cpu
smp_core99_kick_cpu done
[    5.227920] Processor 1 is stuck.
smp_core99_kick_cpu
smp_core99_kick_cpu done
[   10.278140] Processor 2 is stuck.
smp_core99_kick_cpu
smp_core99_kick_cpu done
[   15.309326] Processor 3 is stuck.
[   15.310457] smp: Brought up 1 node, 1 CPU
[   15.336741] devtmpfs: initialized
[   15.358958] Found UniNorth PCI host bridge at 0x00000000f2000000. Firmware bus number: 0->0
[   15.359907] PCI host bridge /pci@f2000000 (primary) ranges:
[   15.362134]   IO 0x00000000f2000000..0x00000000f27fffff -> 0x0000000000000000
[   15.363327]  MEM 0x0000000080000000..0x000000008fffffff -> 0x0000000080000000
[   15.366636] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[   15.367915] futex hash table entries: 1024 (order: 3, 32768 bytes, linear)
[   15.407396] NET: Registered protocol family 16
[   15.416447] audit: initializing netlink subsys (disabled)
[   15.423487] audit: type=2000 audit(1716054549.076:1): state=initialized audit_enabled=0 res=1
[   15.433124] thermal_sys: Registered thermal governor 'fair_share'

[   15.433296] thermal_sys: Registered thermal governor 'step_wise'
[   15.444053] PCI: Probing PCI hardware
[   15.454648] PCI host bridge to bus 0000:00
[   15.455908] pci_bus 0000:00: root bus resource [io  0x0000-0x7fffff]
[   15.457308] pci_bus 0000:00: root bus resource [mem 0x80000000-0x8fffffff]
[   15.458521] pci_bus 0000:00: root bus resource [bus 00-ff]
[   15.459767] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to ff
[   15.464530] pci 0000:00:0b.0: [106b:001f] type 00 class 0x060000
[   15.473861] pci 0000:00:0c.0: [106b:0022] type 00 class 0xff0000
[   15.475845] pci 0000:00:0c.0: reg 0x10: [mem 0x80000000-0x8007ffff]
[   15.481484] pci 0000:00:0d.0: [106b:003f] type 00 class 0x0c0310
[   15.482883] pci 0000:00:0d.0: reg 0x10: [mem 0x80080000-0x800800ff]
[   15.488606] pci 0000:00:0e.0: [1234:1111] type 00 class 0x030000
[   15.490521] pci 0000:00:0e.0: reg 0x10: [mem 0x81000000-0x81ffffff pref]
[   15.494643] pci 0000:00:0e.0: reg 0x18: [mem 0x82000000-0x82000fff]
[   15.501794] pci 0000:00:0e.0: reg 0x30: [mem 0x82010000-0x8201ffff pref]
[   15.503465] pci 0000:00:0f.0: [106b:0021] type 00 class 0x020000
[   15.504560] pci 0000:00:0f.0: reg 0x10: [mem 0x82200000-0x823fffff]
[   15.511499] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 00
[   15.520044] pci_bus 0000:00: resource 4 [io  0x0000-0x7fffff]
[   15.520695] pci_bus 0000:00: resource 5 [mem 0x80000000-0x8fffffff]
[   15.541800] Kprobes globally optimized
[   20.205864] iommu: Default domain type: Translated
[   20.214125] pci 0000:00:0e.0: vgaarb: setting as boot VGA device
[   20.215070] pci 0000:00:0e.0: vgaarb: VGA device added: decodes=io+mem,owns=io+mem,locks=none
[   20.216002] pci 0000:00:0e.0: vgaarb: bridge control possible
[   20.216606] vgaarb: loaded
[   20.220636] SCSI subsystem initialized
[   20.253578] clocksource: Switched to clocksource timebase
[   20.452951] VFS: Disk quotas dquot_6.6.0
[   20.453727] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[   20.460869] AppArmor: AppArmor Filesystem Enabled
[   20.495964] NET: Registered protocol family 2
[   20.498712] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear)
[   20.521739] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[   20.522799] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[   20.523935] TCP bind hash table entries: 4096 (order: 3, 32768 bytes, linear)
[   20.524986] TCP: Hash tables configured (established 4096 bind 4096)
[   20.529295] MPTCP token hash table entries: 512 (order: 1, 8192 bytes, linear)
[   20.530582] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[   20.531628] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[   20.536784] NET: Registered protocol family 1
[   20.537953] NET: Registered protocol family 44
[   20.542641] PCI: CLS 0 bytes, default 32
[   20.550784] Thermal assist unit using workqueue, shrink_timer: 2000 ms
[   20.567668] Initialise system trusted keyrings
[   20.572356] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[   20.594107] zbud: loaded
[   20.601453] Key type asymmetric registered
[   20.602101] Asymmetric key parser 'x509' registered
[   20.602938] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[   20.604717] io scheduler mq-deadline registered
[   20.605353] io scheduler kyber registered
[   20.606241] io scheduler bfq registered
[   20.616132] Using unsupported 800x600 (null) at 81000000, depth=32, pitch=3200
[   20.643222] Console: switching to colour frame buffer device 100x37
[   20.652163] fb0: Open Firmware frame buffer device on /pci@f2000000/QEMU,VGA@e
[   20.655049] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[   20.665430] pmac_zilog: 0.6 (Benjamin Herrenschmidt <benh@kernel.crashing.org>)
[   20.666517] Serial: MPC52xx PSC UART driver
[   20.667710] Non-volatile memory driver v1.3
[   20.668168] Linux agpgart interface v0.103
[   20.672974] MacIO PCI driver attached to Keylargo chipset
[   20.681690] 0.00013020:ch-a: ttyPZ0 at MMIO 0x80013020 (irq = 37, base_baud = 230400) is a Z85c30 ESCC - Serial port
[   20.685655] 0.00013000:ch-b: ttyPZ1 at MMIO 0x80013000 (irq = 36, base_baud = 230400) is a Z85c30 ESCC - Serial port
[   20.691584] Macintosh Cuda and Egret driver.
[   20.700774] mousedev: PS/2 mouse device common for all mice
[   20.706422] rtc-generic rtc-generic: registered as rtc0
[   20.709045] rtc-generic rtc-generic: setting system clock to 2024-05-18T17:49:13 UTC (1716054553)
[   20.712283] ledtrig-cpu: registered to indicate activity on CPUs
[   20.714138] drop_monitor: Initializing network drop monitor service
[   20.717830] NET: Registered protocol family 10
[   20.781504] Segment Routing with IPv6
[   20.782026] RPL Segment Routing with IPv6
[   20.783392] mip6: Mobile IPv6
[   20.784062] NET: Registered protocol family 17
[   20.785965] mpls_gso: MPLS GSO support
[   20.786526] drmem: No dynamic reconfiguration memory found
[   20.790254] registered taskstats version 1
[   20.790931] Loading compiled-in X.509 certificates
[   20.795734] zswap: loaded using pool lzo/zbud
[   20.798771] Key type ._fscrypt registered
[   20.799251] Key type .fscrypt registered
[   20.799670] Key type fscrypt-provisioning registered
[   20.805443] AppArmor: AppArmor sha1 policy hashing enabled
[   20.826459] List of all partitions:
[   20.827118] No filesystem could mount root, tried:
[   20.827160]
[   20.828009] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,1)
[   20.829089] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.13.12_1 #1
[   20.830162] Call Trace:
[   20.830621] [e1039db0] [c05ee5dc] dump_stack+0x9c/0xd0 (unreliable)
[   20.831502] [e1039dd0] [c008e354] panic+0x154/0x364
[   20.831992] [e1039e30] [c0d20958] mount_block_root+0x330/0x384
[   20.832536] [e1039eb0] [c0d20ba8] prepare_namespace+0x170/0x1b4
[   20.833085] [e1039ed0] [c0d20344] kernel_init_freeable+0x238/0x26c
[   20.833656] [e1039f10] [c0007c28] kernel_init+0x20/0x120
[   20.834160] [e1039f30] [c00220fc] ret_from_kernel_thread+0x14/0x1c
[   20.836886] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,1) ]---

so for now CPUs fails to get out of their sleep ....

 
This is all guessing from the above but I think
it's what plausibly happens and there could be several ways to fix it but
to test the easiest may be to get QEMU halt secondary CPU the same way it
does for e500 and implement the register in Keylargo to reset the
secondary CPU. If that works then we can think about if this should be
handled by OpenBIOS or by QEMU but that could also be changed later. I
would not worry about that too much yet as there could be other problem
ahead after this one so let's fix this for now and see what else is there.

Regards,
BALATON Zoltan

Attachment: mac99_second_halt.diff
Description: Text Data


reply via email to

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