Skip to contentSkip to conversation

--disable-tcg avocado fixes for ppc-softmmu

PATCH In review Daniel Henrique Barboza 4 participants 13 messages Mar 10, 2022 – Mar 14, 2022

lore
Share & tools
lore
#0 lore raw

cover --disable-tcg avocado fixes for ppc-softmmu

Hi,

These are more test fixes that I missed from my first series [1]. Thanks Murilo Opsfelder and Fabiano for letting me know that we still had broken tests to deal with.

All these tests were either a case of 'this needs kvm_pr' or 'this needs kvm_hv'. Since avocado doesn't have yet a way of detecting if the host is running kvm_hv or kvm_pr, the workaround for now is to skip them if TCG isn't available.

[1] https://lists.gnu.org/archive/html/qemu-devel/2022-03/msg00866.html

Daniel Henrique Barboza (9):
avocado/boot_linux_console.py: check TCG accel in test_ppc_g3beige() avocado/boot_linux_console.py: check TCG accel in test_ppc_mac99() avocado/ppc_405.py: remove test_ppc_taihu() avocado/ppc_405.py: check TCG accel in test_ppc_ref405ep() avocado/ppc_74xx.py: check TCG accel for all tests avocado/ppc_bamboo.py: check TCG accel in test_ppc_bamboo() avocado/ppc_mpc8544ds.py: check TCG accel in test_ppc_mpc8544ds() avocado/ppc_prep_40p.py: check TCG accel in all tests avocado/ppc_virtex_ml507.py: check TCG accel in

    test_ppc_virtex_ml507()
 tests/avocado/boot_linux_console.py | 12 ++++++++++++
 tests/avocado/ppc_405.py            | 10 ++--------
 tests/avocado/ppc_74xx.py           | 13 +++++++++++++
 tests/avocado/ppc_bamboo.py         |  2 ++
 tests/avocado/ppc_mpc8544ds.py      |  2 ++
 tests/avocado/ppc_prep_40p.py       |  6 ++++++
 tests/avocado/ppc_virtex_ml507.py   |  2 ++
 7 files changed, 39 insertions(+), 8 deletions(-)
Signature · 1 line
2.35.1
#1 lore raw

PATCH 1/9 avocado/boot_linux_console.py: check TCG accel in test_ppc_g3beige()

This test breaks when run in an IBM POWER host with a QEMU compiled with --disable-tcg and the ppc-softmmu target.

One thing to note is that the error message explictly mentions kvm_pr support:

Command: ./qemu-system-ppc -display none -vga none (...) -machine g3beige (...)
Output: ioctl(KVM_CREATE_VM) failed: 22 Invalid argument
PPC KVM module is not loaded. Try modprobe kvm_pr.
qemu-system-ppc: failed to initialize kvm: Invalid argument

The host was running kvm_hv, not kvm_pr, and the machine failed to load.

Unfortunately we don't have a way to detect whether the KVM module loaded is kvm_hv or kvm_pr - we do a check for /dev/kvm to detect KVM support but both modules create this file so that's not helpful.

Let's skip this test for now until we have a way of detecting kvm_pr support in the host.

---
 tests/avocado/boot_linux_console.py | 6 ++++++
 1 file changed, 6 insertions(+)
tests/avocado/boot_linux_console.py +6 -0
index 6d6e748572..2f8d8e2fe6 100644
@@ -1213,7 +1213,13 @@ def test_ppc_g3beige(self):
         """
         :avocado: tags=arch:ppc
         :avocado: tags=machine:g3beige
+        :avocado: tags=accel:tcg
         """
+        # TODO: g3beige works with kvm_pr but we don't have a
+        # reliable way ATM (e.g. looking at /proc/modules) to detect
+        # whether we're running kvm_hv or kvm_pr. For now let's
+        # disable this test if we don't have TCG support.
+        self.require_accelerator("tcg")
         tar_hash = 'e0b872a5eb8fdc5bed19bd43ffe863900ebcedfc'
         self.vm.add_args('-M', 'graphics=off')
         self.do_test_advcal_2018('15', tar_hash, 'invaders.elf')
Signature · 1 line
2.35.1
#2 lore raw

PATCH 2/9 avocado/boot_linux_console.py: check TCG accel in test_ppc_mac99()

In reply to Daniel Henrique Barboza

This test breaks when run in an IBM POWER host with a QEMU compiled with --disable-tcg and the ppc-softmmu target in a similar manner as test_ppc_g3beige did.

There's also an observation made about kvm_pr in the error message:

Command: ./qemu-system-ppc -display none -vga none (...) -machine mac99 (...)
Output: ioctl(KVM_CREATE_VM) failed: 22 Invalid argument
PPC KVM module is not loaded. Try modprobe kvm_pr.
qemu-system-ppc: failed to initialize kvm: Invalid argument

This means that, when/if we're able to detect kvm_pr support in these avocado tests, we can revisit this test to not rely solely on TCG availability.

---
 tests/avocado/boot_linux_console.py | 6 ++++++
 1 file changed, 6 insertions(+)
tests/avocado/boot_linux_console.py +6 -0
index 2f8d8e2fe6..b40a3abc81 100644
@@ -1228,7 +1228,13 @@ def test_ppc_mac99(self):
         """
         :avocado: tags=arch:ppc
         :avocado: tags=machine:mac99
+        :avocado: tags=accel:tcg
         """
+        # TODO: mac99 works with kvm_pr but we don't have a
+        # reliable way ATM (e.g. looking at /proc/modules) to detect
+        # whether we're running kvm_hv or kvm_pr. For now let's
+        # disable this test if we don't have TCG support.
+        self.require_accelerator("tcg")
         tar_hash = 'e0b872a5eb8fdc5bed19bd43ffe863900ebcedfc'
         self.vm.add_args('-M', 'graphics=off')
         self.do_test_advcal_2018('15', tar_hash, 'invaders.elf')
Signature · 1 line
2.35.1
#3 lore raw

PATCH 3/9 avocado/ppc_405.py: remove test_ppc_taihu()

In reply to Daniel Henrique Barboza

Running this test gives us a deprecation warning telling that this machine type is no longer supported:

Output: qemu-system-ppc: Machine type 'taihu' is deprecated:
incomplete, use 'ref405ep' instead

Moreover, this test fails to pass running in an IBM POWER host when building QEMU with --disable-tcg.

Since the machine type is already being considered deprecated let's not bother fixing the test with --disable-tcg. Remove test_ppc_taihu().

---
 tests/avocado/ppc_405.py | 8 --------
 1 file changed, 8 deletions(-)
tests/avocado/ppc_405.py +0 -8
index a47f89b934..a69b7c5e97 100644
@@ -25,14 +25,6 @@ def do_test_ppc405(self):
         wait_for_console_pattern(self, 'AMCC PPC405EP Evaluation Board')
         exec_command_and_wait_for_pattern(self, 'reset', 'AMCC PowerPC 405EP')
 
-    def test_ppc_taihu(self):
-        """
-        :avocado: tags=arch:ppc
-        :avocado: tags=machine:taihu
-        :avocado: tags=cpu:405ep
-        """
-        self.do_test_ppc405()
-
     def test_ppc_ref405ep(self):
         """
         :avocado: tags=arch:ppc
Signature · 1 line
2.35.1
#4 lore raw

PATCH 4/9 avocado/ppc_405.py: check TCG accel in test_ppc_ref405ep()

In reply to Daniel Henrique Barboza

Running this test without TCG support in an IBM POWER server results in the following error:

Command: ./qemu-system-ppc -display none -vga none (...)
-machine ref405ep (...)
Output: qemu-system-ppc: Register sync failed... If you're using
kvm-hv.ko, only "-cpu host" is possible
qemu-system-ppc: kvm_init_vcpu: kvm_arch_init_vcpu failed (0): Invalid argument

Although the host is running kvm_hv we don't have a way of differentiate between kvm_hv and kvm_pr, meaning that this test would've failed in the same way if kvm_pr was the KVM module loaded in the host.

Since we don't have a way of checking which KVM module is being loaded when using avocado, make a TCG accel check in test_ppc_ref405ep().

---
 tests/avocado/ppc_405.py | 2 ++
 1 file changed, 2 insertions(+)
tests/avocado/ppc_405.py +2 -0
index a69b7c5e97..4e7e01aa76 100644
@@ -30,5 +30,7 @@ def test_ppc_ref405ep(self):
         :avocado: tags=arch:ppc
         :avocado: tags=machine:ref405ep
         :avocado: tags=cpu:405ep
+        :avocado: tags=accel:tcg
         """
+        self.require_accelerator("tcg")
         self.do_test_ppc405()
Signature · 1 line
2.35.1
#5 lore raw

PATCH 5/9 avocado/ppc_74xx.py: check TCG accel for all tests

In reply to Daniel Henrique Barboza

All tests of this file, when running in an IBM POWER host and with --disable-tcg, fail in a similar manner:

Command: ./qemu-system-ppc -display none -vga none (...)
-cpu 7400 (...)
Output: ioctl(KVM_CREATE_VM) failed: 22 Invalid argument
PPC KVM module is not loaded. Try modprobe kvm_pr.
qemu-system-ppc: failed to initialize kvm: Invalid argument

We don't have a way of telling which KVM module is loaded in a Power host (kvm_hv or kvm_pr). For now let's make all the tests of this file depend on TCG support.

---
 tests/avocado/ppc_74xx.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)
tests/avocado/ppc_74xx.py +13 -0
index 556a9a7da9..f54757c243 100644
@@ -11,6 +11,7 @@
 class ppc74xxCpu(QemuSystemTest):
     """
     :avocado: tags=arch:ppc
+    :avocado: tags=accel:tcg
     """
     timeout = 5
 
@@ -18,6 +19,7 @@ def test_ppc_7400(self):
         """
         :avocado: tags=cpu:7400
         """
+        self.require_accelerator("tcg")
         self.vm.set_console()
         self.vm.launch()
         wait_for_console_pattern(self, '>> OpenBIOS')
@@ -27,6 +29,7 @@ def test_ppc_7410(self):
         """
         :avocado: tags=cpu:7410
         """
+        self.require_accelerator("tcg")
         self.vm.set_console()
         self.vm.launch()
         wait_for_console_pattern(self, '>> OpenBIOS')
@@ -36,6 +39,7 @@ def test_ppc_7441(self):
         """
         :avocado: tags=cpu:7441
         """
+        self.require_accelerator("tcg")
         self.vm.set_console()
         self.vm.launch()
         wait_for_console_pattern(self, '>> OpenBIOS')
@@ -45,6 +49,7 @@ def test_ppc_7445(self):
         """
         :avocado: tags=cpu:7445
         """
+        self.require_accelerator("tcg")
         self.vm.set_console()
         self.vm.launch()
         wait_for_console_pattern(self, '>> OpenBIOS')
@@ -54,6 +59,7 @@ def test_ppc_7447(self):
         """
         :avocado: tags=cpu:7447
         """
+        self.require_accelerator("tcg")
         self.vm.set_console()
         self.vm.launch()
         wait_for_console_pattern(self, '>> OpenBIOS')
@@ -63,6 +69,7 @@ def test_ppc_7447a(self):
         """
         :avocado: tags=cpu:7447a
         """
+        self.require_accelerator("tcg")
         self.vm.set_console()
         self.vm.launch()
         wait_for_console_pattern(self, '>> OpenBIOS')
@@ -72,6 +79,7 @@ def test_ppc_7448(self):
         """
         :avocado: tags=cpu:7448
         """
+        self.require_accelerator("tcg")
         self.vm.set_console()
         self.vm.launch()
         wait_for_console_pattern(self, '>> OpenBIOS')
@@ -81,6 +89,7 @@ def test_ppc_7450(self):
         """
         :avocado: tags=cpu:7450
         """
+        self.require_accelerator("tcg")
         self.vm.set_console()
         self.vm.launch()
         wait_for_console_pattern(self, '>> OpenBIOS')
@@ -90,6 +99,7 @@ def test_ppc_7451(self):
         """
         :avocado: tags=cpu:7451
         """
+        self.require_accelerator("tcg")
         self.vm.set_console()
         self.vm.launch()
         wait_for_console_pattern(self, '>> OpenBIOS')
@@ -99,6 +109,7 @@ def test_ppc_7455(self):
         """
         :avocado: tags=cpu:7455
         """
+        self.require_accelerator("tcg")
         self.vm.set_console()
         self.vm.launch()
         wait_for_console_pattern(self, '>> OpenBIOS')
@@ -108,6 +119,7 @@ def test_ppc_7457(self):
         """
         :avocado: tags=cpu:7457
         """
+        self.require_accelerator("tcg")
         self.vm.set_console()
         self.vm.launch()
         wait_for_console_pattern(self, '>> OpenBIOS')
@@ -117,6 +129,7 @@ def test_ppc_7457a(self):
         """
         :avocado: tags=cpu:7457a
         """
+        self.require_accelerator("tcg")
         self.vm.set_console()
         self.vm.launch()
         wait_for_console_pattern(self, '>> OpenBIOS')
Signature · 1 line
2.35.1
#6 lore raw

PATCH 6/9 avocado/ppc_bamboo.py: check TCG accel in test_ppc_bamboo()

In reply to Daniel Henrique Barboza

This tests times out in an IBM POWER host when compiled with --disable-tcg.

---
 tests/avocado/ppc_bamboo.py | 2 ++
 1 file changed, 2 insertions(+)
tests/avocado/ppc_bamboo.py +2 -0
index 40629e3478..102ff252df 100644
@@ -20,7 +20,9 @@ def test_ppc_bamboo(self):
         :avocado: tags=machine:bamboo
         :avocado: tags=cpu:440epb
         :avocado: tags=device:rtl8139
+        :avocado: tags=accel:tcg
         """
+        self.require_accelerator("tcg")
         tar_url = ('http://landley.net/aboriginal/downloads/binaries/'
                    'system-image-powerpc-440fp.tar.gz')
         tar_hash = '53e5f16414b195b82d2c70272f81c2eedb39bad9'
Signature · 1 line
2.35.1
#7 lore raw

PATCH 7/9 avocado/ppc_mpc8544ds.py: check TCG accel in test_ppc_mpc8544ds()

In reply to Daniel Henrique Barboza

This tests times out in an IBM POWER host when compiled with --disable-tcg.

---
 tests/avocado/ppc_mpc8544ds.py | 2 ++
 1 file changed, 2 insertions(+)
tests/avocado/ppc_mpc8544ds.py +2 -0
index 886f967b15..8d6a749201 100644
@@ -19,7 +19,9 @@ def test_ppc_mpc8544ds(self):
         """
         :avocado: tags=arch:ppc
         :avocado: tags=machine:mpc8544ds
+        :avocado: tags=accel:tcg
         """
+        self.require_accelerator("tcg")
         tar_url = ('https://www.qemu-advent-calendar.org'
                    '/2020/download/day17.tar.gz')
         tar_hash = '7a5239542a7c4257aa4d3b7f6ddf08fb6775c494'
Signature · 1 line
2.35.1
#8 lore raw

PATCH 8/9 avocado/ppc_prep_40p.py: check TCG accel in all tests

In reply to Daniel Henrique Barboza

All tests in the file times out when running in an IBM POWER host and --disable-tcg with an error like the following:

Command: ./qemu-system-ppc -display none -vga none (...)
-machine 40p (...)
Output: qemu-system-ppc: Register sync failed... If you're using
kvm-hv.ko, only "-cpu host" is possible
qemu-system-ppc: kvm_init_vcpu: kvm_arch_init_vcpu failed (0): Invalid argument

Since we don't have a way to detect whether the host is running kvm_hv or kvm_pr, skip all tests if TCG is not available.

---
 tests/avocado/ppc_prep_40p.py | 6 ++++++
 1 file changed, 6 insertions(+)
tests/avocado/ppc_prep_40p.py +6 -0
index 4bd956584d..d4f1eb7e1d 100644
@@ -28,7 +28,9 @@ def test_factory_firmware_and_netbsd(self):
         :avocado: tags=machine:40p
         :avocado: tags=os:netbsd
         :avocado: tags=slowness:high
+        :avocado: tags=accel:tcg
         """
+        self.require_accelerator("tcg")
         bios_url = ('http://ftpmirror.your.org/pub/misc/'
                     'ftp.software.ibm.com/rs6000/firmware/'
                     '7020-40p/P12H0456.IMG')
@@ -51,7 +53,9 @@ def test_openbios_192m(self):
         """
         :avocado: tags=arch:ppc
         :avocado: tags=machine:40p
+        :avocado: tags=accel:tcg
         """
+        self.require_accelerator("tcg")
         self.vm.set_console()
         self.vm.add_args('-m', '192') # test fw_cfg
 
@@ -65,7 +69,9 @@ def test_openbios_and_netbsd(self):
         :avocado: tags=arch:ppc
         :avocado: tags=machine:40p
         :avocado: tags=os:netbsd
+        :avocado: tags=accel:tcg
         """
+        self.require_accelerator("tcg")
         drive_url = ('https://archive.netbsd.org/pub/NetBSD-archive/'
                      'NetBSD-7.1.2/iso/NetBSD-7.1.2-prep.iso')
         drive_hash = 'ac6fa2707d888b36d6fa64de6e7fe48e'
Signature · 1 line
2.35.1
Reviewed-by on v1 8/9
#9 lore raw

Re: [PATCH 8/9] avocado/ppc_prep_40p.py: check TCG accel in all tests

Quoted 9 lines · Daniel Henrique Barboza

All tests in the file times out when running in an IBM POWER host and --disable-tcg with an error like the following:

Command: ./qemu-system-ppc -display none -vga none (...)
-machine 40p (...)
Output: qemu-system-ppc: Register sync failed... If you're using
kvm-hv.ko, only "-cpu host" is possible
qemu-system-ppc: kvm_init_vcpu: kvm_arch_init_vcpu failed (0): Invalid argument

Quoted 7 lines

Since we don't have a way to detect whether the host is running kvm_hv or kvm_pr, skip all tests if TCG is not available.

---
  tests/avocado/ppc_prep_40p.py | 6 ++++++
  1 file changed, 6 insertions(+)
#10 lore raw

PATCH 9/9 avocado/ppc_virtex_ml507.py: check TCG accel in test_ppc_virtex_ml507()

In reply to Daniel Henrique Barboza

This test times out when running in an IBM POWER host and --disable-tcg.

---
 tests/avocado/ppc_virtex_ml507.py | 2 ++
 1 file changed, 2 insertions(+)
tests/avocado/ppc_virtex_ml507.py +2 -0
index a6912ee579..6b07686b56 100644
@@ -19,7 +19,9 @@ def test_ppc_virtex_ml507(self):
         """
         :avocado: tags=arch:ppc
         :avocado: tags=machine:virtex-ml507
+        :avocado: tags=accel:tcg
         """
+        self.require_accelerator("tcg")
         tar_url = ('https://www.qemu-advent-calendar.org'
                    '/2020/download/hippo.tar.gz')
         tar_hash = '306b95bfe7d147f125aa176a877e266db8ef914a'
Signature · 1 line
2.35.1
Tested-by on the v1 series
#11 lore raw
In reply to Daniel Henrique Barboza
Quoted 26 lines · Daniel Henrique Barboza

Hi,

These are more test fixes that I missed from my first series [1]. Thanks Murilo Opsfelder and Fabiano for letting me know that we still had broken tests to deal with.

All these tests were either a case of 'this needs kvm_pr' or 'this needs kvm_hv'. Since avocado doesn't have yet a way of detecting if the host is running kvm_hv or kvm_pr, the workaround for now is to skip them if TCG isn't available.

[1] https://lists.gnu.org/archive/html/qemu-devel/2022-03/msg00866.html

Daniel Henrique Barboza (9):
avocado/boot_linux_console.py: check TCG accel in test_ppc_g3beige() avocado/boot_linux_console.py: check TCG accel in test_ppc_mac99() avocado/ppc_405.py: remove test_ppc_taihu() avocado/ppc_405.py: check TCG accel in test_ppc_ref405ep() avocado/ppc_74xx.py: check TCG accel for all tests avocado/ppc_bamboo.py: check TCG accel in test_ppc_bamboo() avocado/ppc_mpc8544ds.py: check TCG accel in test_ppc_mpc8544ds() avocado/ppc_prep_40p.py: check TCG accel in all tests avocado/ppc_virtex_ml507.py: check TCG accel in

     test_ppc_virtex_ml507()
Quoted 9 lines
  tests/avocado/boot_linux_console.py | 12 ++++++++++++
  tests/avocado/ppc_405.py            | 10 ++--------
  tests/avocado/ppc_74xx.py           | 13 +++++++++++++
  tests/avocado/ppc_bamboo.py         |  2 ++
  tests/avocado/ppc_mpc8544ds.py      |  2 ++
  tests/avocado/ppc_prep_40p.py       |  6 ++++++
  tests/avocado/ppc_virtex_ml507.py   |  2 ++
  7 files changed, 39 insertions(+), 8 deletions(-)

Hi, Daniel.

With this series and series "--disable-tcg qtest/avocado fixes for ppc64" [0] applied, check-avocado passed for QEMU built with --disable-tcg --disable-linux-user.

[0] https://lists.nongnu.org/archive/html/qemu-devel/2022-03/msg00866.html

So:

Signature · 1 line
Murilo
#12 lore raw
In reply to Daniel Henrique Barboza
Quoted 26 lines · Daniel Henrique Barboza

Hi,

These are more test fixes that I missed from my first series [1]. Thanks Murilo Opsfelder and Fabiano for letting me know that we still had broken tests to deal with.

All these tests were either a case of 'this needs kvm_pr' or 'this needs kvm_hv'. Since avocado doesn't have yet a way of detecting if the host is running kvm_hv or kvm_pr, the workaround for now is to skip them if TCG isn't available.

[1] https://lists.gnu.org/archive/html/qemu-devel/2022-03/msg00866.html

Daniel Henrique Barboza (9):
avocado/boot_linux_console.py: check TCG accel in test_ppc_g3beige() avocado/boot_linux_console.py: check TCG accel in test_ppc_mac99() avocado/ppc_405.py: remove test_ppc_taihu() avocado/ppc_405.py: check TCG accel in test_ppc_ref405ep() avocado/ppc_74xx.py: check TCG accel for all tests avocado/ppc_bamboo.py: check TCG accel in test_ppc_bamboo() avocado/ppc_mpc8544ds.py: check TCG accel in test_ppc_mpc8544ds() avocado/ppc_prep_40p.py: check TCG accel in all tests avocado/ppc_virtex_ml507.py: check TCG accel in

     test_ppc_virtex_ml507()
Quoted 9 lines
  tests/avocado/boot_linux_console.py | 12 ++++++++++++
  tests/avocado/ppc_405.py            | 10 ++--------
  tests/avocado/ppc_74xx.py           | 13 +++++++++++++
  tests/avocado/ppc_bamboo.py         |  2 ++
  tests/avocado/ppc_mpc8544ds.py      |  2 ++
  tests/avocado/ppc_prep_40p.py       |  6 ++++++
  tests/avocado/ppc_virtex_ml507.py   |  2 ++
  7 files changed, 39 insertions(+), 8 deletions(-)

Queued for 7.0

Thanks,

C.