Skip to contentSkip to conversation

tests/functional: Add a ppc64 mac99 test

PATCH Superseded Cédric Le Goater 5 participants 12 messages Jan 28, 2025 – Jan 29, 2025 Arm/Amlogic Meson SoC support

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/functional: Add a ppc64 mac99 test

The test sequence boots from disk a mac99 machine in 64-bit mode, in which case the CPU is a PPC 970.

The buildroot rootfs is built with config :

BR2_powerpc64=y
BR2_powerpc_970=y

and the kernel with the g5 deconfig.

---
 MAINTAINERS                          |  1 +
 tests/functional/meson.build         |  2 ++
 tests/functional/test_ppc64_mac99.py | 45 ++++++++++++++++++++++++++++
 3 files changed, 48 insertions(+)
 create mode 100644 tests/functional/test_ppc64_mac99.py
MAINTAINERS +1 -0
index 3a2291d17d7e..ebf249173f00 100644
@@ -1446,6 +1446,7 @@ F: include/hw/pci-host/uninorth.h
 F: include/hw/input/adb*
 F: pc-bios/qemu_vga.ndrv
 F: tests/functional/test_ppc_mac.py
+F: tests/functional/test_ppc64_mac99.py
 
 Old World (g3beige)
 M: Mark Cave-Ayland <[email protected]>
tests/functional/meson.build +2 -0
index 01a87b03e553..821a0a7c49ac 100644
@@ -41,6 +41,7 @@ test_timeouts = {
   'ppc64_powernv' : 480,
   'ppc64_pseries' : 480,
   'ppc64_tuxrun' : 420,
+  'ppc64_mac99' : 120,
   'riscv64_tuxrun' : 120,
   's390x_ccw_virtio' : 420,
   'sh4_tuxrun' : 240,
@@ -181,6 +182,7 @@ tests_ppc64_system_thorough = [
   'ppc64_powernv',
   'ppc64_pseries',
   'ppc64_tuxrun',
+  'ppc64_mac99',
 ]
 
 tests_riscv32_system_quick = [
tests/functional/test_ppc64_mac99.py new file +45 -0

45 lines not on this page · raw message

Signature · 1 line
2.48.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 72 lines · Cédric Le Goater

The test sequence boots from disk a mac99 machine in 64-bit mode, in which case the CPU is a PPC 970.

The buildroot rootfs is built with config :

BR2_powerpc64=y
BR2_powerpc_970=y

and the kernel with the g5 deconfig.

---
  MAINTAINERS                          |  1 +
  tests/functional/meson.build         |  2 ++
  tests/functional/test_ppc64_mac99.py | 45 ++++++++++++++++++++++++++++
  3 files changed, 48 insertions(+)

create mode 100644 tests/functional/test_ppc64_mac99.py

MAINTAINERS +1 -0
index 3a2291d17d7e..ebf249173f00 100644
@@ -1446,6 +1446,7 @@ F: include/hw/pci-host/uninorth.h
  F: include/hw/input/adb*
  F: pc-bios/qemu_vga.ndrv
  F: tests/functional/test_ppc_mac.py
+F: tests/functional/test_ppc64_mac99.py
 
  Old World (g3beige)
  M: Mark Cave-Ayland <[email protected]>
tests/functional/meson.build +2 -0
index 01a87b03e553..821a0a7c49ac 100644
@@ -41,6 +41,7 @@ test_timeouts = {
    'ppc64_powernv' : 480,
    'ppc64_pseries' : 480,
    'ppc64_tuxrun' : 420,
+  'ppc64_mac99' : 120,
    'riscv64_tuxrun' : 120,
    's390x_ccw_virtio' : 420,
    'sh4_tuxrun' : 240,
@@ -181,6 +182,7 @@ tests_ppc64_system_thorough = [
    'ppc64_powernv',
    'ppc64_pseries',
    'ppc64_tuxrun',
+  'ppc64_mac99',
  ]
 
  tests_riscv32_system_quick = [
tests/functional/test_ppc64_mac99.py new file +16 -0
new file mode 100644
index 000000000000..ba582d267dae
@@ -0,0 +1,45 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots a mac99 machine with a PPC970 CPU
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test import exec_command_and_wait_for_pattern
+
+class mac99Test(LinuxKernelTest):
+
+    ASSET_BR2_MAC99_LINUX = Asset(
+        'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main/buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/vmlinux',
+        'd59307437e4365f2cced0bbd1b04949f7397b282ef349b7cafd894d74aadfbff')
+
+    ASSET_BR2_MAC99_ROOTFS = Asset(

tests/functional/test_ppc64_mac99.py line 26

Quoted 10 lines
tests/functional/test_ppc64_mac99.py new file +10 -0
+        'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main//buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/rootfs.ext2',
+        'bbd5fd8af62f580bc4e585f326fe584e22856572633a8333178ea6d4ed4955a4')
+
+    def test_ppc64_mac99_buildroot(self):
+        self.require_netdev('user')
+
+        linux_path = self.ASSET_BR2_MAC99_LINUX.fetch()
+        rootfs_path = self.ASSET_BR2_MAC99_ROOTFS.fetch()
+
+        self.set_machine('mac99')

Nit: Move the set_machine to the top of the function, so that the assets don't have to be fetched in case the machine is not available.

With that nit fixed:

tests/functional/test_ppc64_mac99.py line 33

Quoted 7 lines
tests/functional/test_ppc64_mac99.py new file +7 -0
+        self.vm.set_console()
+
+        self.vm.add_args('-kernel', linux_path,
+                         '-append', 'root=/dev/sda',
+                         '-drive', f'file={rootfs_path},format=raw',
+                         '-net', 'nic,model=sungem', '-net', 'user',
+                         '-snapshot', '-nographic')

I just also noticed that we already have "-display none" in python/qemu/machine/machine.py, so you likely don't need the -nographic here (but looks like we've got that wrong in a bunch of tests already).

Quoted 12 lines
tests/functional/test_ppc64_mac99.py new file +12 -0
+        self.vm.launch()
+
+        self.wait_for_console_pattern('>> OpenBIOS')
+        self.wait_for_console_pattern('Linux version')
+        self.wait_for_console_pattern('/init as init process')
+        self.wait_for_console_pattern('gem 0000:f0:0e.0 eth0: Link is up at 100 Mbps')
+        self.wait_for_console_pattern('buildroot login:')
+        exec_command_and_wait_for_pattern(self, 'root', '#')
+        exec_command_and_wait_for_pattern(self, 'poweroff', 'Power down')
+
+if __name__ == '__main__':
+    LinuxKernelTest.main()
#2 lore raw
Quoted 79 lines · Thomas Huth
Quoted 78 lines · Cédric Le Goater

The test sequence boots from disk a mac99 machine in 64-bit mode, in which case the CPU is a PPC 970.

The buildroot rootfs is built with config :

BR2_powerpc64=y
BR2_powerpc_970=y

and the kernel with the g5 deconfig.

---
  MAINTAINERS                          |  1 + tests/functional/meson.build         |  2 ++ tests/functional/test_ppc64_mac99.py | 45 ++++++++++++++++++++++++++++

  3 files changed, 48 insertions(+)

  create mode 100644 tests/functional/test_ppc64_mac99.py

MAINTAINERS +0 -0
index 3a2291d17d7e..ebf249173f00 100644
@@ -1446,6 +1446,7 @@ F: include/hw/pci-host/uninorth.h

  F: include/hw/input/adb*
  F: pc-bios/qemu_vga.ndrv
  F: tests/functional/test_ppc_mac.py
+F: tests/functional/test_ppc64_mac99.py
  Old World (g3beige)
  M: Mark Cave-Ayland <[email protected]>

tests/functional/meson.build +2 -0
index 01a87b03e553..821a0a7c49ac 100644
@@ -41,6 +41,7 @@ test_timeouts = {
     'ppc64_powernv' : 480,
     'ppc64_pseries' : 480,
     'ppc64_tuxrun' : 420,
+  'ppc64_mac99' : 120,
     'riscv64_tuxrun' : 120,
     's390x_ccw_virtio' : 420,
     'sh4_tuxrun' : 240,
@@ -181,6 +182,7 @@ tests_ppc64_system_thorough = [
     'ppc64_powernv',
     'ppc64_pseries',
     'ppc64_tuxrun',
+  'ppc64_mac99',

  ]
  tests_riscv32_system_quick = [

tests/functional/test_ppc64_mac99.py new file +13 -0
new file mode 100644
index 000000000000..ba582d267dae
@@ -0,0 +1,45 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots a mac99 machine with a PPC970 CPU
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test import exec_command_and_wait_for_pattern
+
+class mac99Test(LinuxKernelTest):
+
+    ASSET_BR2_MAC99_LINUX = Asset(
+        'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/ 

main/buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/vmlinux', + 'd59307437e4365f2cced0bbd1b04949f7397b282ef349b7cafd894d74aadfbff') +
+    ASSET_BR2_MAC99_ROOTFS = Asset(
+        'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/ main//buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/ rootfs.ext2', + 'bbd5fd8af62f580bc4e585f326fe584e22856572633a8333178ea6d4ed4955a4') +
+    def test_ppc64_mac99_buildroot(self):

Quoted 8 lines

tests/functional/test_ppc64_mac99.py line 26

Quoted 6 lines

+        self.require_netdev('user')

tests/functional/test_ppc64_mac99.py new file +5 -0
+
+        linux_path = self.ASSET_BR2_MAC99_LINUX.fetch()
+        rootfs_path = self.ASSET_BR2_MAC99_ROOTFS.fetch()
+
+        self.set_machine('mac99')

Nit: Move the set_machine to the top of the function, so that the assets don't have to be fetched in case the machine is not available.

Nice to know, this is not obvious. Should we check for unset machine in fetch()? Or add fetch_for_machine()... Nitpicking yet more :p

Quoted 13 lines

With that nit fixed:

Quoted 7 lines

+        self.vm.set_console()
+
+        self.vm.add_args('-kernel', linux_path,
+                         '-append', 'root=/dev/sda',
+                         '-drive', f'file={rootfs_path},format=raw', +                         '-net', 'nic,model=sungem', '-net', 'user', +                         '-snapshot', '-nographic')

Quoted 1 line

I just also noticed that we already have "-display none" in python/qemu/ machine/machine.py, so you likely don't need the -nographic here (but looks like we've got that wrong in a bunch of tests already).

Maybe warn in QEMUMachine::_pre_launch() if "-display none" && '-nographic'?

Quoted 2 lines
Quoted 2 lines

+        self.vm.launch()

#3 lore raw
In reply to Thomas Huth
Quoted 96 lines · Thomas Huth
Quoted 70 lines · Cédric Le Goater

The test sequence boots from disk a mac99 machine in 64-bit mode, in which case the CPU is a PPC 970.

The buildroot rootfs is built with config :

BR2_powerpc64=y
BR2_powerpc_970=y

and the kernel with the g5 deconfig.

---
  MAINTAINERS                          |  1 + tests/functional/meson.build         |  2 ++ tests/functional/test_ppc64_mac99.py | 45 ++++++++++++++++++++++++++++

  3 files changed, 48 insertions(+)

  create mode 100644 tests/functional/test_ppc64_mac99.py

MAINTAINERS +0 -0
index 3a2291d17d7e..ebf249173f00 100644
@@ -1446,6 +1446,7 @@ F: include/hw/pci-host/uninorth.h

  F: include/hw/input/adb*
  F: pc-bios/qemu_vga.ndrv
  F: tests/functional/test_ppc_mac.py
+F: tests/functional/test_ppc64_mac99.py
  Old World (g3beige)
  M: Mark Cave-Ayland <[email protected]>

tests/functional/meson.build +2 -0
index 01a87b03e553..821a0a7c49ac 100644
@@ -41,6 +41,7 @@ test_timeouts = {
     'ppc64_powernv' : 480,
     'ppc64_pseries' : 480,
     'ppc64_tuxrun' : 420,
+  'ppc64_mac99' : 120,
     'riscv64_tuxrun' : 120,
     's390x_ccw_virtio' : 420,
     'sh4_tuxrun' : 240,
@@ -181,6 +182,7 @@ tests_ppc64_system_thorough = [
     'ppc64_powernv',
     'ppc64_pseries',
     'ppc64_tuxrun',
+  'ppc64_mac99',

  ]
  tests_riscv32_system_quick = [

tests/functional/test_ppc64_mac99.py new file +16 -0
new file mode 100644
index 000000000000..ba582d267dae
@@ -0,0 +1,45 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots a mac99 machine with a PPC970 CPU
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test import exec_command_and_wait_for_pattern
+
+class mac99Test(LinuxKernelTest):
+
+    ASSET_BR2_MAC99_LINUX = Asset(
+        'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main/buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/vmlinux',
+        'd59307437e4365f2cced0bbd1b04949f7397b282ef349b7cafd894d74aadfbff')
+
+    ASSET_BR2_MAC99_ROOTFS = Asset(

tests/functional/test_ppc64_mac99.py line 26

Quoted 10 lines
tests/functional/test_ppc64_mac99.py new file +10 -0
+        'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main//buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/rootfs.ext2',
+        'bbd5fd8af62f580bc4e585f326fe584e22856572633a8333178ea6d4ed4955a4')
+
+    def test_ppc64_mac99_buildroot(self):
+        self.require_netdev('user')
+
+        linux_path = self.ASSET_BR2_MAC99_LINUX.fetch()
+        rootfs_path = self.ASSET_BR2_MAC99_ROOTFS.fetch()
+
+        self.set_machine('mac99')

Nit: Move the set_machine to the top of the function, so that the assets don't have to be fetched in case the machine is not available.

With that nit fixed:

tests/functional/test_ppc64_mac99.py line 33

Quoted 7 lines
tests/functional/test_ppc64_mac99.py new file +7 -0
+        self.vm.set_console()
+
+        self.vm.add_args('-kernel', linux_path,
+                         '-append', 'root=/dev/sda',
+                         '-drive', f'file={rootfs_path},format=raw',
+                         '-net', 'nic,model=sungem', '-net', 'user',
+                         '-snapshot', '-nographic')
Quoted 1 line

I just also noticed that we already have "-display none" in python/qemu/machine/machine.py, so you likely don't need the -nographic here (but looks like we've got that wrong in a bunch of tests already).

I think we need -nographic else OpenBIOS crashes. I will check.

Thanks,

C.

Quoted 14 lines
Quoted 13 lines
tests/functional/test_ppc64_mac99.py new file +12 -0
+        self.vm.launch()
+
+        self.wait_for_console_pattern('>> OpenBIOS')
+        self.wait_for_console_pattern('Linux version')
+        self.wait_for_console_pattern('/init as init process')
+        self.wait_for_console_pattern('gem 0000:f0:0e.0 eth0: Link is up at 100 Mbps')
+        self.wait_for_console_pattern('buildroot login:')
+        exec_command_and_wait_for_pattern(self, 'root', '#')
+        exec_command_and_wait_for_pattern(self, 'poweroff', 'Power down')
+
+if __name__ == '__main__':
+    LinuxKernelTest.main()
#4 lore raw
Quoted 99 lines · Cédric Le Goater
Quoted 98 lines · Thomas Huth
Quoted 74 lines · Cédric Le Goater

The test sequence boots from disk a mac99 machine in 64-bit mode, in which case the CPU is a PPC 970.

The buildroot rootfs is built with config :

BR2_powerpc64=y
BR2_powerpc_970=y

and the kernel with the g5 deconfig.

---
  MAINTAINERS                          |  1 + tests/functional/meson.build         |  2 ++ tests/functional/test_ppc64_mac99.py | 45 ++++++++++++++++++++++++++++

  3 files changed, 48 insertions(+)

  create mode 100644 tests/functional/test_ppc64_mac99.py

MAINTAINERS +0 -0
index 3a2291d17d7e..ebf249173f00 100644
@@ -1446,6 +1446,7 @@ F: include/hw/pci-host/uninorth.h

  F: include/hw/input/adb*
  F: pc-bios/qemu_vga.ndrv
  F: tests/functional/test_ppc_mac.py
+F: tests/functional/test_ppc64_mac99.py
  Old World (g3beige)
  M: Mark Cave-Ayland <[email protected]>

tests/functional/meson.build +2 -0
index 01a87b03e553..821a0a7c49ac 100644
@@ -41,6 +41,7 @@ test_timeouts = {
     'ppc64_powernv' : 480,
     'ppc64_pseries' : 480,
     'ppc64_tuxrun' : 420,
+  'ppc64_mac99' : 120,
     'riscv64_tuxrun' : 120,
     's390x_ccw_virtio' : 420,
     'sh4_tuxrun' : 240,
@@ -181,6 +182,7 @@ tests_ppc64_system_thorough = [
     'ppc64_powernv',
     'ppc64_pseries',
     'ppc64_tuxrun',
+  'ppc64_mac99',

  ]
  tests_riscv32_system_quick = [

tests/functional/test_ppc64_mac99.py new file +13 -0
new file mode 100644
index 000000000000..ba582d267dae
@@ -0,0 +1,45 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots a mac99 machine with a PPC970 CPU
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test import exec_command_and_wait_for_pattern
+
+class mac99Test(LinuxKernelTest):
+
+    ASSET_BR2_MAC99_LINUX = Asset(
+        'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main/ 

buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/vmlinux', +        'd59307437e4365f2cced0bbd1b04949f7397b282ef349b7cafd894d74aadfbff') +
+    ASSET_BR2_MAC99_ROOTFS = Asset(
+        'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main// buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/rootfs.ext2', +        'bbd5fd8af62f580bc4e585f326fe584e22856572633a8333178ea6d4ed4955a4')

tests/functional/test_ppc64_mac99.py line 26

Quoted 8 lines
tests/functional/test_ppc64_mac99.py new file +8 -0
+
+    def test_ppc64_mac99_buildroot(self):
+        self.require_netdev('user')
+
+        linux_path = self.ASSET_BR2_MAC99_LINUX.fetch()
+        rootfs_path = self.ASSET_BR2_MAC99_ROOTFS.fetch()
+
+        self.set_machine('mac99')

Nit: Move the set_machine to the top of the function, so that the assets don't have to be fetched in case the machine is not available.

With that nit fixed:

Quoted 7 lines

+        self.vm.set_console()
+
+        self.vm.add_args('-kernel', linux_path,
+                         '-append', 'root=/dev/sda',
+                         '-drive', f'file={rootfs_path},format=raw', +                         '-net', 'nic,model=sungem', '-net', 'user', +                         '-snapshot', '-nographic')

Quoted 3 lines
Quoted 1 line

I just also noticed that we already have "-display none" in python/qemu/ machine/machine.py, so you likely don't need the -nographic here (but looks like we've got that wrong in a bunch of tests already).

I think we need -nographic else OpenBIOS crashes.  I will check.

Oh, you're right, OpenBIOS hangs with "milliseconds isn't unique" when running "qemu-system-ppc64 -M mac99 -display none -serial stdio" ... that's weird... so you need to keep the -nographic here, indeed!

Thomas

#5 lore raw
Quoted 102 lines · Thomas Huth
Quoted 101 lines · Cédric Le Goater
Quoted 100 lines · Thomas Huth
Quoted 76 lines · Cédric Le Goater

The test sequence boots from disk a mac99 machine in 64-bit mode, in which case the CPU is a PPC 970.

The buildroot rootfs is built with config :

BR2_powerpc64=y
BR2_powerpc_970=y

and the kernel with the g5 deconfig.

---
  MAINTAINERS                          |  1 + tests/functional/meson.build         |  2 ++ tests/functional/test_ppc64_mac99.py | 45 ++++++++++++++++++++++++++++

  3 files changed, 48 insertions(+)

  create mode 100644 tests/functional/test_ppc64_mac99.py

MAINTAINERS +0 -0
index 3a2291d17d7e..ebf249173f00 100644
@@ -1446,6 +1446,7 @@ F: include/hw/pci-host/uninorth.h

  F: include/hw/input/adb*
  F: pc-bios/qemu_vga.ndrv
  F: tests/functional/test_ppc_mac.py
+F: tests/functional/test_ppc64_mac99.py
  Old World (g3beige)
  M: Mark Cave-Ayland <[email protected]>

tests/functional/meson.build +2 -0
index 01a87b03e553..821a0a7c49ac 100644
@@ -41,6 +41,7 @@ test_timeouts = {
     'ppc64_powernv' : 480,
     'ppc64_pseries' : 480,
     'ppc64_tuxrun' : 420,
+  'ppc64_mac99' : 120,
     'riscv64_tuxrun' : 120,
     's390x_ccw_virtio' : 420,
     'sh4_tuxrun' : 240,
@@ -181,6 +182,7 @@ tests_ppc64_system_thorough = [
     'ppc64_powernv',
     'ppc64_pseries',
     'ppc64_tuxrun',
+  'ppc64_mac99',

  ]
  tests_riscv32_system_quick = [

tests/functional/test_ppc64_mac99.py new file +13 -0
new file mode 100644
index 000000000000..ba582d267dae
@@ -0,0 +1,45 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots a mac99 machine with a PPC970 CPU
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test import exec_command_and_wait_for_pattern
+
+class mac99Test(LinuxKernelTest):
+
+    ASSET_BR2_MAC99_LINUX = Asset(
+        'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main/ 

buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/vmlinux', + 'd59307437e4365f2cced0bbd1b04949f7397b282ef349b7cafd894d74aadfbff') +
+    ASSET_BR2_MAC99_ROOTFS = Asset(
+        'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main// buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/rootfs.ext2', + 'bbd5fd8af62f580bc4e585f326fe584e22856572633a8333178ea6d4ed4955a4')

tests/functional/test_ppc64_mac99.py line 26

Quoted 8 lines
tests/functional/test_ppc64_mac99.py new file +8 -0
+
+    def test_ppc64_mac99_buildroot(self):
+        self.require_netdev('user')
+
+        linux_path = self.ASSET_BR2_MAC99_LINUX.fetch()
+        rootfs_path = self.ASSET_BR2_MAC99_ROOTFS.fetch()
+
+        self.set_machine('mac99')

Nit: Move the set_machine to the top of the function, so that the assets don't have to be fetched in case the machine is not available.

With that nit fixed:

Quoted 7 lines

+        self.vm.set_console()
+
+        self.vm.add_args('-kernel', linux_path,
+                         '-append', 'root=/dev/sda',
+                         '-drive', f'file={rootfs_path},format=raw', +                         '-net', 'nic,model=sungem', '-net', 'user', +                         '-snapshot', '-nographic')

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

I just also noticed that we already have "-display none" in python/qemu/ machine/machine.py, so you likely don't need the -nographic here (but looks like we've got that wrong in a bunch of tests already).

I think we need -nographic else OpenBIOS crashes.  I will check.

Oh, you're right, OpenBIOS hangs with "milliseconds isn't unique" when running "qemu-system-ppc64 -M mac99 -display none -serial stdio" ... that's weird... so you need to keep the -nographic here, indeed!

That's because of -display none, without that you can see the output in the window. I think if OpenBIOS finds a VGA card it tries to output there so you have to remove that too to get output on serial. But if you have a kernel to boot it may still boot with -display none but you have to tell it to use serial separately with -append.

Regards,
BALATON Zoltan

#6 lore raw
Quoted 3 lines · BALATON Zoltan
Quoted 1 line

Oh, you're right, OpenBIOS hangs with "milliseconds isn't unique" when running "qemu- system-ppc64 -M mac99 -display none -serial stdio" ... that's weird... so you need to keep the -nographic here, indeed!

That's because of -display none, without that you can see the output in the window. I think if OpenBIOS finds a VGA card it tries to output there so you have to remove that too to get output on serial.

Yes. You need to add -vga none to remove the graphics card. With -display none, you merely remove the qemu interface.

r~

#7 lore raw
In reply to Thomas Huth
Quoted 102 lines · Thomas Huth
Quoted 101 lines · Cédric Le Goater
Quoted 100 lines · Thomas Huth
Quoted 76 lines · Cédric Le Goater

The test sequence boots from disk a mac99 machine in 64-bit mode, in which case the CPU is a PPC 970.

The buildroot rootfs is built with config :

BR2_powerpc64=y
BR2_powerpc_970=y

and the kernel with the g5 deconfig.

---
  MAINTAINERS                          |  1 + tests/functional/meson.build         |  2 ++ tests/functional/test_ppc64_mac99.py | 45 ++++++++++++++++++++++++++++

  3 files changed, 48 insertions(+)

  create mode 100644 tests/functional/test_ppc64_mac99.py

MAINTAINERS +0 -0
index 3a2291d17d7e..ebf249173f00 100644
@@ -1446,6 +1446,7 @@ F: include/hw/pci-host/uninorth.h

  F: include/hw/input/adb*
  F: pc-bios/qemu_vga.ndrv
  F: tests/functional/test_ppc_mac.py
+F: tests/functional/test_ppc64_mac99.py
  Old World (g3beige)
  M: Mark Cave-Ayland <[email protected]>

tests/functional/meson.build +2 -0
index 01a87b03e553..821a0a7c49ac 100644
@@ -41,6 +41,7 @@ test_timeouts = {
     'ppc64_powernv' : 480,
     'ppc64_pseries' : 480,
     'ppc64_tuxrun' : 420,
+  'ppc64_mac99' : 120,
     'riscv64_tuxrun' : 120,
     's390x_ccw_virtio' : 420,
     'sh4_tuxrun' : 240,
@@ -181,6 +182,7 @@ tests_ppc64_system_thorough = [
     'ppc64_powernv',
     'ppc64_pseries',
     'ppc64_tuxrun',
+  'ppc64_mac99',

  ]
  tests_riscv32_system_quick = [

tests/functional/test_ppc64_mac99.py new file +13 -0
new file mode 100644
index 000000000000..ba582d267dae
@@ -0,0 +1,45 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots a mac99 machine with a PPC970 CPU
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test import exec_command_and_wait_for_pattern
+
+class mac99Test(LinuxKernelTest):
+
+    ASSET_BR2_MAC99_LINUX = Asset(
+        'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main/ 

buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/vmlinux', + 'd59307437e4365f2cced0bbd1b04949f7397b282ef349b7cafd894d74aadfbff') +
+    ASSET_BR2_MAC99_ROOTFS = Asset(
+        'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main// buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/rootfs.ext2', + 'bbd5fd8af62f580bc4e585f326fe584e22856572633a8333178ea6d4ed4955a4')

tests/functional/test_ppc64_mac99.py line 26

Quoted 8 lines
tests/functional/test_ppc64_mac99.py new file +8 -0
+
+    def test_ppc64_mac99_buildroot(self):
+        self.require_netdev('user')
+
+        linux_path = self.ASSET_BR2_MAC99_LINUX.fetch()
+        rootfs_path = self.ASSET_BR2_MAC99_ROOTFS.fetch()
+
+        self.set_machine('mac99')

Nit: Move the set_machine to the top of the function, so that the assets don't have to be fetched in case the machine is not available.

With that nit fixed:

Quoted 7 lines

+        self.vm.set_console()
+
+        self.vm.add_args('-kernel', linux_path,
+                         '-append', 'root=/dev/sda',
+                         '-drive', f'file={rootfs_path},format=raw', +                         '-net', 'nic,model=sungem', '-net', 'user', +                         '-snapshot', '-nographic')

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

I just also noticed that we already have "-display none" in python/qemu/ machine/machine.py, so you likely don't need the -nographic here (but looks like we've got that wrong in a bunch of tests already).

I think we need -nographic else OpenBIOS crashes.  I will check.

Oh, you're right, OpenBIOS hangs with "milliseconds isn't unique" when

The "milliseconds isn't unique" is something you always get, this has something to do with how it's implemented in OpenBIOS but it was deemed harmless. (I don't remember the details but it's also unrelated to this.)

Regards,
BALATON Zoltan

Quoted 6 lines

running "qemu-system-ppc64 -M mac99 -display none -serial stdio" ... that's weird... so you need to keep the -nographic here, indeed!

Thomas

#8 lore raw
In reply to Thomas Huth
Quoted 102 lines · Thomas Huth
Quoted 101 lines · Cédric Le Goater
Quoted 100 lines · Thomas Huth
Quoted 76 lines · Cédric Le Goater

The test sequence boots from disk a mac99 machine in 64-bit mode, in which case the CPU is a PPC 970.

The buildroot rootfs is built with config :

BR2_powerpc64=y
BR2_powerpc_970=y

and the kernel with the g5 deconfig.

---
  MAINTAINERS                          |  1 + tests/functional/meson.build         |  2 ++ tests/functional/test_ppc64_mac99.py | 45 ++++++++++++++++++++++++++++

  3 files changed, 48 insertions(+)

  create mode 100644 tests/functional/test_ppc64_mac99.py

MAINTAINERS +0 -0
index 3a2291d17d7e..ebf249173f00 100644
@@ -1446,6 +1446,7 @@ F: include/hw/pci-host/uninorth.h

  F: include/hw/input/adb*
  F: pc-bios/qemu_vga.ndrv
  F: tests/functional/test_ppc_mac.py
+F: tests/functional/test_ppc64_mac99.py
  Old World (g3beige)
  M: Mark Cave-Ayland <[email protected]>

tests/functional/meson.build +2 -0
index 01a87b03e553..821a0a7c49ac 100644
@@ -41,6 +41,7 @@ test_timeouts = {
     'ppc64_powernv' : 480,
     'ppc64_pseries' : 480,
     'ppc64_tuxrun' : 420,
+  'ppc64_mac99' : 120,
     'riscv64_tuxrun' : 120,
     's390x_ccw_virtio' : 420,
     'sh4_tuxrun' : 240,
@@ -181,6 +182,7 @@ tests_ppc64_system_thorough = [
     'ppc64_powernv',
     'ppc64_pseries',
     'ppc64_tuxrun',
+  'ppc64_mac99',

  ]
  tests_riscv32_system_quick = [

tests/functional/test_ppc64_mac99.py new file +13 -0
new file mode 100644
index 000000000000..ba582d267dae
@@ -0,0 +1,45 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots a mac99 machine with a PPC970 CPU
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test import exec_command_and_wait_for_pattern
+
+class mac99Test(LinuxKernelTest):
+
+    ASSET_BR2_MAC99_LINUX = Asset(
+        'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main/ 

buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/vmlinux', + 'd59307437e4365f2cced0bbd1b04949f7397b282ef349b7cafd894d74aadfbff') +
+    ASSET_BR2_MAC99_ROOTFS = Asset(
+        'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main// buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/rootfs.ext2', + 'bbd5fd8af62f580bc4e585f326fe584e22856572633a8333178ea6d4ed4955a4')

tests/functional/test_ppc64_mac99.py line 26

Quoted 8 lines
tests/functional/test_ppc64_mac99.py new file +8 -0
+
+    def test_ppc64_mac99_buildroot(self):
+        self.require_netdev('user')
+
+        linux_path = self.ASSET_BR2_MAC99_LINUX.fetch()
+        rootfs_path = self.ASSET_BR2_MAC99_ROOTFS.fetch()
+
+        self.set_machine('mac99')

Nit: Move the set_machine to the top of the function, so that the assets don't have to be fetched in case the machine is not available.

With that nit fixed:

Quoted 7 lines

+        self.vm.set_console()
+
+        self.vm.add_args('-kernel', linux_path,
+                         '-append', 'root=/dev/sda',
+                         '-drive', f'file={rootfs_path},format=raw', +                         '-net', 'nic,model=sungem', '-net', 'user', +                         '-snapshot', '-nographic')

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

I just also noticed that we already have "-display none" in python/qemu/ machine/machine.py, so you likely don't need the -nographic here (but looks like we've got that wrong in a bunch of tests already).

I think we need -nographic else OpenBIOS crashes.  I will check.

Oh, you're right, OpenBIOS hangs with "milliseconds isn't unique" when running "qemu-system-ppc64 -M mac99 -display none -serial stdio" ... that's weird... so you need to keep the -nographic here, indeed!

qemu-system-ppc64 -M mac99 -display none -vga none -serial stdio

does work.

Regards,
BALATON Zoltan

#9 lore raw
In reply to Cédric Le Goater
Quoted 93 lines · Cédric Le Goater
Quoted 92 lines · Thomas Huth
Quoted 76 lines · Cédric Le Goater

The test sequence boots from disk a mac99 machine in 64-bit mode, in which case the CPU is a PPC 970.

The buildroot rootfs is built with config :

BR2_powerpc64=y
BR2_powerpc_970=y

and the kernel with the g5 deconfig.

---
  MAINTAINERS                          |  1 + tests/functional/meson.build         |  2 ++ tests/functional/test_ppc64_mac99.py | 45 ++++++++++++++++++++++++++++

  3 files changed, 48 insertions(+)

  create mode 100644 tests/functional/test_ppc64_mac99.py

MAINTAINERS +0 -0
index 3a2291d17d7e..ebf249173f00 100644
@@ -1446,6 +1446,7 @@ F: include/hw/pci-host/uninorth.h

  F: include/hw/input/adb*
  F: pc-bios/qemu_vga.ndrv
  F: tests/functional/test_ppc_mac.py
+F: tests/functional/test_ppc64_mac99.py
  Old World (g3beige)
  M: Mark Cave-Ayland <[email protected]>

tests/functional/meson.build +2 -0
index 01a87b03e553..821a0a7c49ac 100644
@@ -41,6 +41,7 @@ test_timeouts = {
     'ppc64_powernv' : 480,
     'ppc64_pseries' : 480,
     'ppc64_tuxrun' : 420,
+  'ppc64_mac99' : 120,
     'riscv64_tuxrun' : 120,
     's390x_ccw_virtio' : 420,
     'sh4_tuxrun' : 240,
@@ -181,6 +182,7 @@ tests_ppc64_system_thorough = [
     'ppc64_powernv',
     'ppc64_pseries',
     'ppc64_tuxrun',
+  'ppc64_mac99',

  ]
  tests_riscv32_system_quick = [

tests/functional/test_ppc64_mac99.py new file +13 -0
new file mode 100644
index 000000000000..ba582d267dae
@@ -0,0 +1,45 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots a mac99 machine with a PPC970 CPU
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test import exec_command_and_wait_for_pattern
+
+class mac99Test(LinuxKernelTest):
+
+    ASSET_BR2_MAC99_LINUX = Asset(
+        

'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main/buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/vmlinux', +
'd59307437e4365f2cced0bbd1b04949f7397b282ef349b7cafd894d74aadfbff')
+
+    ASSET_BR2_MAC99_ROOTFS = Asset(
+ 'https://github.com/legoater/qemu-ppc-boot/raw/refs/heads/main//buildroot/qemu_ppc64_mac99-2023.11-8-gdcd9f0f6eb-20240105/rootfs.ext2', +
'bbd5fd8af62f580bc4e585f326fe584e22856572633a8333178ea6d4ed4955a4')

tests/functional/test_ppc64_mac99.py line 26

Quoted 8 lines
tests/functional/test_ppc64_mac99.py new file +8 -0
+
+    def test_ppc64_mac99_buildroot(self):
+        self.require_netdev('user')
+
+        linux_path = self.ASSET_BR2_MAC99_LINUX.fetch()
+        rootfs_path = self.ASSET_BR2_MAC99_ROOTFS.fetch()
+
+        self.set_machine('mac99')

Nit: Move the set_machine to the top of the function, so that the assets don't have to be fetched in case the machine is not available.

With that nit fixed:

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

+        self.vm.set_console()
+
+        self.vm.add_args('-kernel', linux_path,
+                         '-append', 'root=/dev/sda',
+                         '-drive', f'file={rootfs_path},format=raw', +                         '-net', 'nic,model=sungem', '-net', 'user',

The machine already has a default sungem NIC so maybe you can omit that too. The user network used to be the default so even that may not be needed but I'm not sure if that's still the case since libslirp was moved out. Wasn't the preferred option -netdev user nowadays and -device for the card?

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

+                         '-snapshot', '-nographic')

I just also noticed that we already have "-display none" in python/qemu/machine/machine.py, so you likely don't need the -nographic here (but looks like we've got that wrong in a bunch of tests already).

I think we need -nographic else OpenBIOS crashes. I will check.

It should not crash but maybe it displays then on the graphics output so you won't get the needed feedback on serial? Although -append 'console=tty<whatever it's called on that machine>' might fix that. But using -nographic makes sense for a serial only test.

Regards,
BALATON Zoltan

#10 lore raw
Quoted 9 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

+        self.vm.set_console()
+
+        self.vm.add_args('-kernel', linux_path,
+                         '-append', 'root=/dev/sda',
+                         '-drive', f'file={rootfs_path},format=raw', +                         '-net', 'nic,model=sungem', '-net', 'user',

The machine already has a default sungem NIC so maybe you can omit that too.

Yes. It works well without it. Will remove the nic.

Quoted 9 lines

The user network used to be the default so even that may not be needed but I'm not sure if that's still the case since libslirp was moved out. Wasn't the preferred option -netdev user nowadays and -device for the card?

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

+                         '-snapshot', '-nographic')

I just also noticed that we already have "-display none" in python/qemu/machine/machine.py, so you likely don't need the -nographic here (but looks like we've got that wrong in a bunch of tests already).

I think we need -nographic else OpenBIOS crashes.  I will check.

It should not crash

It doesn't crash indeed, but it complains :

  2025-01-28 21:55:24,498: >> CPU type PowerPC,970FX
  2025-01-28 21:55:24,501: milliseconds isn't unique.
  2025-01-28 21:55:24,540: Output device screen not found.
  2025-01-28 21:55:24,545: Output device screen not found.
  2025-01-28 21:55:24,548: >> [ppc] Kernel already loaded (0x01000000 + 0x014a8b58) (initrd 0x00000000 + 0x00000000)
  2025-01-28 21:55:24,548: >> [ppc] Kernel command line: root=/dev/sda
  2025-01-28 21:55:24,560: >> switching to new context:
  2025-01-28 21:55:24,567: NULL ihandle
  2025-01-28 21:55:24,567: Unexpected client interface exception: -2

and there is no console ouput. With -nographic :

  2025-01-28 22:19:42,938: >> CPU type PowerPC,970FX
  2025-01-28 22:19:42,941: milliseconds isn't unique.
  2025-01-28 22:19:42,993: Welcome to OpenBIOS v1.1 built on Sep 24 2024 19:56
  2025-01-28 22:19:42,997: >> [ppc] Kernel already loaded (0x01000000 + 0x014a8b58) (initrd 0x00000000 + 0x00000000)
  2025-01-28 22:19:42,997: >> [ppc] Kernel command line: root=/dev/sda
  2025-01-28 22:19:43,010: >> switching to new context:
  2025-01-28 22:19:43,018: OF stdout device is: /pci@f0000000/mac-io@c/escc@13000/ch-a@13020
Quoted 1 line

but maybe it displays then on the graphics output so you won't get the needed feedback on serial? Although -append 'console=tty<whatever it's called on that machine>' might fix that.

Nope.

Quoted 1 line

But using -nographic makes sense for a serial only test.

I will keep -nographic for this test.

Thanks,
C.

#11 lore raw
Quoted 34 lines · Cédric Le Goater
Quoted 8 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

+        self.vm.set_console()
+
+        self.vm.add_args('-kernel', linux_path,
+                         '-append', 'root=/dev/sda',
+                         '-drive', f'file={rootfs_path},format=raw', +                         '-net', 'nic,model=sungem', '-net', 'user',

The machine already has a default sungem NIC so maybe you can omit that too.

Yes. It works well without it. Will remove the nic.

Quoted 9 lines

The user network used to be the default so even that may not be needed but I'm not sure if that's still the case since libslirp was moved out. Wasn't the preferred option -netdev user nowadays and -device for the card?

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

+                         '-snapshot', '-nographic')

I just also noticed that we already have "-display none" in python/qemu/machine/machine.py, so you likely don't need the -nographic here (but looks like we've got that wrong in a bunch of tests already).

I think we need -nographic else OpenBIOS crashes.  I will check.

It should not crash

It doesn't crash indeed, but it complains :

 2025-01-28 21:55:24,498: >> CPU type PowerPC,970FX
 2025-01-28 21:55:24,501: milliseconds isn't unique.
 2025-01-28 21:55:24,540: Output device screen not found.
 2025-01-28 21:55:24,545: Output device screen not found.
 2025-01-28 21:55:24,548: >> [ppc] Kernel already loaded (0x01000000 + 
0x014a8b58) (initrd 0x00000000 + 0x00000000)
 2025-01-28 21:55:24,548: >> [ppc] Kernel command line: root=/dev/sda
 2025-01-28 21:55:24,560: >> switching to new context:
 2025-01-28 21:55:24,567: NULL ihandle
 2025-01-28 21:55:24,567: Unexpected client interface exception: -2
Quoted 1 line

and there is no console ouput. With -nographic :

I think the Linux platform init code outputs something via OpenFirmware before it parses the command line and OpenBIOS can't handle that when there's no display. So either -vga none or -nographic is needed to remove the VGA card and get OpenBIOS to fall back to serial.

Regards,
BALATON Zoltan

Quoted 25 lines
 2025-01-28 22:19:42,938: >> CPU type PowerPC,970FX
 2025-01-28 22:19:42,941: milliseconds isn't unique.
 2025-01-28 22:19:42,993: Welcome to OpenBIOS v1.1 built on Sep 24 2024 
19:56
 2025-01-28 22:19:42,997: >> [ppc] Kernel already loaded (0x01000000 + 
0x014a8b58) (initrd 0x00000000 + 0x00000000)
 2025-01-28 22:19:42,997: >> [ppc] Kernel command line: root=/dev/sda
 2025-01-28 22:19:43,010: >> switching to new context:
 2025-01-28 22:19:43,018: OF stdout device is: 

/pci@f0000000/mac-io@c/escc@13000/ch-a@13020

Quoted 1 line

but maybe it displays then on the graphics output so you won't get the needed feedback on serial? Although -append 'console=tty<whatever it's called on that machine>' might fix that.

Nope.

Quoted 1 line

But using -nographic makes sense for a serial only test.

I will keep -nographic for this test.

Thanks,
C.