All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] --disable-tcg qtest/avocado fixes for ppc64
@ 2022-03-03 15:35 Daniel Henrique Barboza
  2022-03-03 15:35 ` [PATCH 1/5] qtest/meson.build: check CONFIG_TCG for prom-env-test in qtests_ppc Daniel Henrique Barboza
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Daniel Henrique Barboza @ 2022-03-03 15:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: thuth, Daniel Henrique Barboza, qemu-ppc, clg, crosa, david

Hi,

'make check' and 'make check-avocado' in a ppc64 host, using a QEMU
built with --disable-tcg, fails in a handful of tests/files due to the
lack of TCG support not being accounted for. The tests usually fall back
to KVM acceleration, and when running in an IBM POWER server this accel
type isn't able to run any other machine but 'pseries'. 

This series aims to fix it by checking for CONFIG_TCG in
qtest/meson.build, and using require_accelerator('tcg') in avocado
tests. I avoided changing the behavior when running the tests in other
host architectures because I can't assert about how KVM behaves in x86 and
aarch64. Patches 1, 2 and 4 were limited to ppc/ppc64 tests only because
of that.

Patch 5 is something that I am fairly confident that affects all archs
so the change is made in the common code for everyone.


Daniel Henrique Barboza (5):
  qtest/meson.build: check CONFIG_TCG for prom-env-test in qtests_ppc
  qtest/meson.build: check CONFIG_TCG for boot-serial-test in qtests_ppc
  avocado/boot_linux_console.py: check for tcg in test_ppc_powernv8/9
  avocado/boot_linux_console.py: check tcg accel in test_ppc64_e500
  avocado/replay_kernel.py: make tcg-icount check in run_vm()

 tests/avocado/boot_linux_console.py | 5 +++++
 tests/avocado/replay_kernel.py      | 4 ++++
 tests/qtest/meson.build             | 4 +++-
 3 files changed, 12 insertions(+), 1 deletion(-)

-- 
2.35.1



^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 1/5] qtest/meson.build: check CONFIG_TCG for prom-env-test in qtests_ppc
  2022-03-03 15:35 [PATCH 0/5] --disable-tcg qtest/avocado fixes for ppc64 Daniel Henrique Barboza
@ 2022-03-03 15:35 ` Daniel Henrique Barboza
  2022-03-07  7:57   ` Thomas Huth
  2022-03-03 15:35 ` [PATCH 2/5] qtest/meson.build: check CONFIG_TCG for boot-serial-test " Daniel Henrique Barboza
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Daniel Henrique Barboza @ 2022-03-03 15:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: thuth, Daniel Henrique Barboza, qemu-ppc, clg, crosa, david

'prom-env-test' is a TCG test that will fail if QEMU is compiled with
--disable-tcg:

$ QTEST_QEMU_BINARY=./qemu-system-ppc64 ./tests/qtest/prom-env-test
/ppc64/prom-env/mac99: qemu-system-ppc64: -accel tcg: invalid accelerator tcg
(... hangs indefinitely ...)

Fix it by checking CONFIG_TCG before compiling prom-env-test.

Cc: Thomas Huth <thuth@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
 tests/qtest/meson.build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index f33d84d19b..0c2f2d94e1 100644
--- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build
@@ -160,7 +160,8 @@ qtests_ppc = \
   (slirp.found() ? ['test-netfilter'] : []) + \
   (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +            \
   (config_all_devices.has_key('CONFIG_M48T59') ? ['m48t59-test'] : []) +                     \
-  ['boot-order-test', 'prom-env-test', 'boot-serial-test']                 \
+  (config_all_devices.has_key('CONFIG_TCG') ? ['prom-env-test'] : []) +                      \
+  ['boot-order-test', 'boot-serial-test']
 
 qtests_ppc64 = \
   qtests_ppc + \
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/5] qtest/meson.build: check CONFIG_TCG for boot-serial-test in qtests_ppc
  2022-03-03 15:35 [PATCH 0/5] --disable-tcg qtest/avocado fixes for ppc64 Daniel Henrique Barboza
  2022-03-03 15:35 ` [PATCH 1/5] qtest/meson.build: check CONFIG_TCG for prom-env-test in qtests_ppc Daniel Henrique Barboza
@ 2022-03-03 15:35 ` Daniel Henrique Barboza
  2022-03-07  8:00   ` Thomas Huth
  2022-03-03 15:35 ` [PATCH 3/5] avocado/boot_linux_console.py: check for tcg in test_ppc_powernv8/9 Daniel Henrique Barboza
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Daniel Henrique Barboza @ 2022-03-03 15:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: thuth, Daniel Henrique Barboza, qemu-ppc, clg, crosa, david

'boot-serial-test' does not work with a QEMU built with --disable-tcg in
a IBM POWER9 host. The reason is that without TCG QEMU will default to
KVM acceleration, but then the KVM module in IBM POWER hosts aren't able
to handle other CPUs.

The result is that the test will break with a KVM error when trying to
ruin the ppce500 test:

$ QTEST_QEMU_BINARY=./qemu-system-ppc64 ./tests/qtest/boot-serial-test
/ppc64/boot-serial/ppce500: qemu-system-ppc64: -accel tcg: invalid accelerator tcg
error: kvm run failed Invalid argument
NIP 0000000000f00000   LR 0000000000000000 CTR 0000000000000000 XER 0000000000000000 CPU#0
MSR 0000000000000000 HID0 0000000000000000  HF 24020002 iidx 1 didx 1
TB 00000000 00000000 DECR 0
(...)
** (./tests/qtest/boot-serial-test:1935760): ERROR **: 07:44:03.010: Failed to find expected string. Please check '/tmp/qtest-boot-serial-sJ78sqg'

Fix it by checking CONFIG_TCG before compiling boot-serial-test.

Cc: Thomas Huth <thuth@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
 tests/qtest/meson.build | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index 0c2f2d94e1..deed640d7f 100644
--- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build
@@ -161,7 +161,8 @@ qtests_ppc = \
   (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +            \
   (config_all_devices.has_key('CONFIG_M48T59') ? ['m48t59-test'] : []) +                     \
   (config_all_devices.has_key('CONFIG_TCG') ? ['prom-env-test'] : []) +                      \
-  ['boot-order-test', 'boot-serial-test']
+  (config_all_devices.has_key('CONFIG_TCG') ? ['boot-serial-test'] : []) +                   \
+  ['boot-order-test']
 
 qtests_ppc64 = \
   qtests_ppc + \
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 3/5] avocado/boot_linux_console.py: check for tcg in test_ppc_powernv8/9
  2022-03-03 15:35 [PATCH 0/5] --disable-tcg qtest/avocado fixes for ppc64 Daniel Henrique Barboza
  2022-03-03 15:35 ` [PATCH 1/5] qtest/meson.build: check CONFIG_TCG for prom-env-test in qtests_ppc Daniel Henrique Barboza
  2022-03-03 15:35 ` [PATCH 2/5] qtest/meson.build: check CONFIG_TCG for boot-serial-test " Daniel Henrique Barboza
@ 2022-03-03 15:35 ` Daniel Henrique Barboza
  2022-03-03 16:08   ` Cédric Le Goater
  2022-03-04 12:23   ` Philippe Mathieu-Daudé
  2022-03-03 15:35 ` [PATCH 4/5] avocado/boot_linux_console.py: check tcg accel in test_ppc64_e500 Daniel Henrique Barboza
                   ` (2 subsequent siblings)
  5 siblings, 2 replies; 15+ messages in thread
From: Daniel Henrique Barboza @ 2022-03-03 15:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: thuth, Daniel Henrique Barboza, qemu-ppc, clg, crosa, david

The PowerNV8/9 machines does not work with KVM acceleration, meaning
that boot_linux_console.py:BootLinuxConsole.test_ppc_powernv8/9 tests
will always fail when QEMU is compiled with --disable-tcg:

ERROR 1-tests/avocado/boot_linux_console.py:BootLinuxConsole.test_ppc_powernv8
-> VMLaunchFailure: ConnectError: Failed to establish session:
[Errno 104] Connection reset by peer
        Exit code: 1
        Command: ./qemu-system-ppc64 -display none -vga none -chardev socket,id=mon,path=/var/tmp/avo_qemu_sock_no19zg0m/qemu-1936936-7fffa77cff98-monitor.sock -mon chardev=mon,mode=control -machine powernv8 -chardev socket,id=console,path=/var/tmp/avo_qemu_sock_no19zg0m/qemu-1936936-7fffa77cff98-console.sock,server=on,wait=off -serial chardev:console -kernel /home/danielhb/avocado/data/cache/by_location/4514304e2c4ee84c5f0b5c8bacedda783891df68/zImage.epapr -append console=tty0 console=hvc0 -device pcie-pci-bridge,id=bridge1,bus=pcie.1,addr=0x0 -device nvme,bus=pcie.2,addr=0x0,serial=1234 -device e1000e,bus=bridge1,addr=0x3 -device nec-usb-xhci,bus=bridge1,addr=0x2
        Output: qemu-system-ppc64: The powernv machine does not work with KVM acceleration

Let's add the TCG accel requirement in both tests to skip them if we
don't have TCG support available.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
 tests/avocado/boot_linux_console.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
index 9c618d4809..d7d9130329 100644
--- a/tests/avocado/boot_linux_console.py
+++ b/tests/avocado/boot_linux_console.py
@@ -1170,6 +1170,7 @@ def test_ppc64_e500(self):
         self.do_test_advcal_2018('19', tar_hash, 'uImage')
 
     def do_test_ppc64_powernv(self, proc):
+        self.require_accelerator("tcg")
         images_url = ('https://github.com/open-power/op-build/releases/download/v2.7/')
 
         kernel_url = images_url + 'zImage.epapr'
@@ -1194,6 +1195,7 @@ def test_ppc_powernv8(self):
         """
         :avocado: tags=arch:ppc64
         :avocado: tags=machine:powernv8
+        :avocado: tags=accel:tcg
         """
         self.do_test_ppc64_powernv('P8')
 
@@ -1201,6 +1203,7 @@ def test_ppc_powernv9(self):
         """
         :avocado: tags=arch:ppc64
         :avocado: tags=machine:powernv9
+        :avocado: tags=accel:tcg
         """
         self.do_test_ppc64_powernv('P9')
 
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 4/5] avocado/boot_linux_console.py: check tcg accel in test_ppc64_e500
  2022-03-03 15:35 [PATCH 0/5] --disable-tcg qtest/avocado fixes for ppc64 Daniel Henrique Barboza
                   ` (2 preceding siblings ...)
  2022-03-03 15:35 ` [PATCH 3/5] avocado/boot_linux_console.py: check for tcg in test_ppc_powernv8/9 Daniel Henrique Barboza
@ 2022-03-03 15:35 ` Daniel Henrique Barboza
  2022-03-03 16:08   ` Cédric Le Goater
  2022-03-03 15:35 ` [PATCH 5/5] avocado/replay_kernel.py: make tcg-icount check in run_vm() Daniel Henrique Barboza
  2022-03-14 15:22 ` [PATCH 0/5] --disable-tcg qtest/avocado fixes for ppc64 Cédric Le Goater
  5 siblings, 1 reply; 15+ messages in thread
From: Daniel Henrique Barboza @ 2022-03-03 15:35 UTC (permalink / raw)
  To: qemu-devel; +Cc: thuth, Daniel Henrique Barboza, qemu-ppc, clg, crosa, david

Some ppc64 hosts (e.g. IBM POWER hosts) aren't able to run the e500
machine using KVM accel. Skip this test if TCG accel isn't available.

Cc: Cleber Rosa <crosa@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
 tests/avocado/boot_linux_console.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
index d7d9130329..6d6e748572 100644
--- a/tests/avocado/boot_linux_console.py
+++ b/tests/avocado/boot_linux_console.py
@@ -1165,7 +1165,9 @@ def test_ppc64_e500(self):
         :avocado: tags=arch:ppc64
         :avocado: tags=machine:ppce500
         :avocado: tags=cpu:e5500
+        :avocado: tags=accel:tcg
         """
+        self.require_accelerator("tcg")
         tar_hash = '6951d86d644b302898da2fd701739c9406527fe1'
         self.do_test_advcal_2018('19', tar_hash, 'uImage')
 
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 5/5] avocado/replay_kernel.py: make tcg-icount check in run_vm()
  2022-03-03 15:35 [PATCH 0/5] --disable-tcg qtest/avocado fixes for ppc64 Daniel Henrique Barboza
                   ` (3 preceding siblings ...)
  2022-03-03 15:35 ` [PATCH 4/5] avocado/boot_linux_console.py: check tcg accel in test_ppc64_e500 Daniel Henrique Barboza
@ 2022-03-03 15:35 ` Daniel Henrique Barboza
  2022-03-07  8:47   ` Cédric Le Goater
  2022-03-14 15:22 ` [PATCH 0/5] --disable-tcg qtest/avocado fixes for ppc64 Cédric Le Goater
  5 siblings, 1 reply; 15+ messages in thread
From: Daniel Henrique Barboza @ 2022-03-03 15:35 UTC (permalink / raw)
  To: qemu-devel
  Cc: thuth, Daniel Henrique Barboza, qemu-ppc, clg, Pavel Dovgalyuk,
	crosa, david

The icount framework relies on TCG availability. If QEMU is built with
--disable-tcg we won't have icount either, and then this test will fail
with the following message in an IBM POWER9 host:

tests/avocado/replay_kernel.py:ReplayKernelNormal.test_ppc64_pseries:
ERROR: ConnectError: Failed to establish session:
(...)
/11-tests_avocado_replay_kernel.py_ReplayKernelNormal.test_ppc64_pseries/replay.bin:
cannot configure icount, TCG support not available

Although this was revealed in a specific ppc64 scenario, the TCG check
is being done in the common code inside run_vm() because all archs need
TCG to have access to icount.

Cc: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
 tests/avocado/replay_kernel.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/avocado/replay_kernel.py b/tests/avocado/replay_kernel.py
index c68a953730..0b2b0dc692 100644
--- a/tests/avocado/replay_kernel.py
+++ b/tests/avocado/replay_kernel.py
@@ -36,6 +36,9 @@ class ReplayKernelBase(LinuxKernelTest):
 
     def run_vm(self, kernel_path, kernel_command_line, console_pattern,
                record, shift, args, replay_path):
+        # icount requires TCG to be available
+        self.require_accelerator('tcg')
+
         logger = logging.getLogger('replay')
         start_time = time.time()
         vm = self.get_vm()
@@ -243,6 +246,7 @@ def test_ppc64_pseries(self):
         """
         :avocado: tags=arch:ppc64
         :avocado: tags=machine:pseries
+        :avocado: tags=accel:tcg
         """
         kernel_url = ('https://archives.fedoraproject.org/pub/archive'
                       '/fedora-secondary/releases/29/Everything/ppc64le/os'
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/5] avocado/boot_linux_console.py: check for tcg in test_ppc_powernv8/9
  2022-03-03 15:35 ` [PATCH 3/5] avocado/boot_linux_console.py: check for tcg in test_ppc_powernv8/9 Daniel Henrique Barboza
@ 2022-03-03 16:08   ` Cédric Le Goater
  2022-03-04 12:23   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 15+ messages in thread
From: Cédric Le Goater @ 2022-03-03 16:08 UTC (permalink / raw)
  To: Daniel Henrique Barboza, qemu-devel; +Cc: thuth, crosa, qemu-ppc, david

On 3/3/22 16:35, Daniel Henrique Barboza wrote:
> The PowerNV8/9 machines does not work with KVM acceleration, meaning
> that boot_linux_console.py:BootLinuxConsole.test_ppc_powernv8/9 tests
> will always fail when QEMU is compiled with --disable-tcg:
> 
> ERROR 1-tests/avocado/boot_linux_console.py:BootLinuxConsole.test_ppc_powernv8
> -> VMLaunchFailure: ConnectError: Failed to establish session:
> [Errno 104] Connection reset by peer
>          Exit code: 1
>          Command: ./qemu-system-ppc64 -display none -vga none -chardev socket,id=mon,path=/var/tmp/avo_qemu_sock_no19zg0m/qemu-1936936-7fffa77cff98-monitor.sock -mon chardev=mon,mode=control -machine powernv8 -chardev socket,id=console,path=/var/tmp/avo_qemu_sock_no19zg0m/qemu-1936936-7fffa77cff98-console.sock,server=on,wait=off -serial chardev:console -kernel /home/danielhb/avocado/data/cache/by_location/4514304e2c4ee84c5f0b5c8bacedda783891df68/zImage.epapr -append console=tty0 console=hvc0 -device pcie-pci-bridge,id=bridge1,bus=pcie.1,addr=0x0 -device nvme,bus=pcie.2,addr=0x0,serial=1234 -device e1000e,bus=bridge1,addr=0x3 -device nec-usb-xhci,bus=bridge1,addr=0x2
>          Output: qemu-system-ppc64: The powernv machine does not work with KVM acceleration
> 
> Let's add the TCG accel requirement in both tests to skip them if we
> don't have TCG support available.
> 
> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>

Reviewed-by: Cédric Le Goater <clg@kaod.org>

Thanks,

C.

> ---
>   tests/avocado/boot_linux_console.py | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
> index 9c618d4809..d7d9130329 100644
> --- a/tests/avocado/boot_linux_console.py
> +++ b/tests/avocado/boot_linux_console.py
> @@ -1170,6 +1170,7 @@ def test_ppc64_e500(self):
>           self.do_test_advcal_2018('19', tar_hash, 'uImage')
>   
>       def do_test_ppc64_powernv(self, proc):
> +        self.require_accelerator("tcg")
>           images_url = ('https://github.com/open-power/op-build/releases/download/v2.7/')
>   
>           kernel_url = images_url + 'zImage.epapr'
> @@ -1194,6 +1195,7 @@ def test_ppc_powernv8(self):
>           """
>           :avocado: tags=arch:ppc64
>           :avocado: tags=machine:powernv8
> +        :avocado: tags=accel:tcg
>           """
>           self.do_test_ppc64_powernv('P8')
>   
> @@ -1201,6 +1203,7 @@ def test_ppc_powernv9(self):
>           """
>           :avocado: tags=arch:ppc64
>           :avocado: tags=machine:powernv9
> +        :avocado: tags=accel:tcg
>           """
>           self.do_test_ppc64_powernv('P9')
>   



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 4/5] avocado/boot_linux_console.py: check tcg accel in test_ppc64_e500
  2022-03-03 15:35 ` [PATCH 4/5] avocado/boot_linux_console.py: check tcg accel in test_ppc64_e500 Daniel Henrique Barboza
@ 2022-03-03 16:08   ` Cédric Le Goater
  0 siblings, 0 replies; 15+ messages in thread
From: Cédric Le Goater @ 2022-03-03 16:08 UTC (permalink / raw)
  To: Daniel Henrique Barboza, qemu-devel; +Cc: thuth, crosa, qemu-ppc, david

On 3/3/22 16:35, Daniel Henrique Barboza wrote:
> Some ppc64 hosts (e.g. IBM POWER hosts) aren't able to run the e500
> machine using KVM accel. Skip this test if TCG accel isn't available.
> 
> Cc: Cleber Rosa <crosa@redhat.com>
> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>


Reviewed-by: Cédric Le Goater <clg@kaod.org>

Thanks,

C.

> ---
>   tests/avocado/boot_linux_console.py | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
> index d7d9130329..6d6e748572 100644
> --- a/tests/avocado/boot_linux_console.py
> +++ b/tests/avocado/boot_linux_console.py
> @@ -1165,7 +1165,9 @@ def test_ppc64_e500(self):
>           :avocado: tags=arch:ppc64
>           :avocado: tags=machine:ppce500
>           :avocado: tags=cpu:e5500
> +        :avocado: tags=accel:tcg
>           """
> +        self.require_accelerator("tcg")
>           tar_hash = '6951d86d644b302898da2fd701739c9406527fe1'
>           self.do_test_advcal_2018('19', tar_hash, 'uImage')
>   



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/5] avocado/boot_linux_console.py: check for tcg in test_ppc_powernv8/9
  2022-03-03 15:35 ` [PATCH 3/5] avocado/boot_linux_console.py: check for tcg in test_ppc_powernv8/9 Daniel Henrique Barboza
  2022-03-03 16:08   ` Cédric Le Goater
@ 2022-03-04 12:23   ` Philippe Mathieu-Daudé
  1 sibling, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-03-04 12:23 UTC (permalink / raw)
  To: Daniel Henrique Barboza, qemu-devel; +Cc: thuth, david, qemu-ppc, clg, crosa

On 3/3/22 16:35, Daniel Henrique Barboza wrote:
> The PowerNV8/9 machines does not work with KVM acceleration, meaning
> that boot_linux_console.py:BootLinuxConsole.test_ppc_powernv8/9 tests
> will always fail when QEMU is compiled with --disable-tcg:
> 
> ERROR 1-tests/avocado/boot_linux_console.py:BootLinuxConsole.test_ppc_powernv8
> -> VMLaunchFailure: ConnectError: Failed to establish session:
> [Errno 104] Connection reset by peer
>          Exit code: 1
>          Command: ./qemu-system-ppc64 -display none -vga none -chardev socket,id=mon,path=/var/tmp/avo_qemu_sock_no19zg0m/qemu-1936936-7fffa77cff98-monitor.sock -mon chardev=mon,mode=control -machine powernv8 -chardev socket,id=console,path=/var/tmp/avo_qemu_sock_no19zg0m/qemu-1936936-7fffa77cff98-console.sock,server=on,wait=off -serial chardev:console -kernel /home/danielhb/avocado/data/cache/by_location/4514304e2c4ee84c5f0b5c8bacedda783891df68/zImage.epapr -append console=tty0 console=hvc0 -device pcie-pci-bridge,id=bridge1,bus=pcie.1,addr=0x0 -device nvme,bus=pcie.2,addr=0x0,serial=1234 -device e1000e,bus=bridge1,addr=0x3 -device nec-usb-xhci,bus=bridge1,addr=0x2
>          Output: qemu-system-ppc64: The powernv machine does not work with KVM acceleration
> 
> Let's add the TCG accel requirement in both tests to skip them if we
> don't have TCG support available.
> 
> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
> ---
>   tests/avocado/boot_linux_console.py | 3 +++
>   1 file changed, 3 insertions(+)

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/5] qtest/meson.build: check CONFIG_TCG for prom-env-test in qtests_ppc
  2022-03-03 15:35 ` [PATCH 1/5] qtest/meson.build: check CONFIG_TCG for prom-env-test in qtests_ppc Daniel Henrique Barboza
@ 2022-03-07  7:57   ` Thomas Huth
  0 siblings, 0 replies; 15+ messages in thread
From: Thomas Huth @ 2022-03-07  7:57 UTC (permalink / raw)
  To: Daniel Henrique Barboza, qemu-devel; +Cc: crosa, qemu-ppc, clg, david

On 03/03/2022 16.35, Daniel Henrique Barboza wrote:
> 'prom-env-test' is a TCG test that will fail if QEMU is compiled with
> --disable-tcg:
> 
> $ QTEST_QEMU_BINARY=./qemu-system-ppc64 ./tests/qtest/prom-env-test
> /ppc64/prom-env/mac99: qemu-system-ppc64: -accel tcg: invalid accelerator tcg
> (... hangs indefinitely ...)
> 
> Fix it by checking CONFIG_TCG before compiling prom-env-test.

I guess it could be made somehow working by using KVM-PR for the mac 
machines ... but considering the bad shape of KVM-PR nowadays, I think it's 
fair to limit the test to TCG-only now.

Reviewed-by: Thomas Huth <thuth@redhat.com>


> Cc: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
> ---
>   tests/qtest/meson.build | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
> index f33d84d19b..0c2f2d94e1 100644
> --- a/tests/qtest/meson.build
> +++ b/tests/qtest/meson.build
> @@ -160,7 +160,8 @@ qtests_ppc = \
>     (slirp.found() ? ['test-netfilter'] : []) + \
>     (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +            \
>     (config_all_devices.has_key('CONFIG_M48T59') ? ['m48t59-test'] : []) +                     \
> -  ['boot-order-test', 'prom-env-test', 'boot-serial-test']                 \
> +  (config_all_devices.has_key('CONFIG_TCG') ? ['prom-env-test'] : []) +                      \
> +  ['boot-order-test', 'boot-serial-test']
>   
>   qtests_ppc64 = \
>     qtests_ppc + \



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/5] qtest/meson.build: check CONFIG_TCG for boot-serial-test in qtests_ppc
  2022-03-03 15:35 ` [PATCH 2/5] qtest/meson.build: check CONFIG_TCG for boot-serial-test " Daniel Henrique Barboza
@ 2022-03-07  8:00   ` Thomas Huth
  0 siblings, 0 replies; 15+ messages in thread
From: Thomas Huth @ 2022-03-07  8:00 UTC (permalink / raw)
  To: Daniel Henrique Barboza, qemu-devel; +Cc: crosa, qemu-ppc, clg, david

On 03/03/2022 16.35, Daniel Henrique Barboza wrote:
> 'boot-serial-test' does not work with a QEMU built with --disable-tcg in
> a IBM POWER9 host. The reason is that without TCG QEMU will default to
> KVM acceleration, but then the KVM module in IBM POWER hosts aren't able
> to handle other CPUs.
> 
> The result is that the test will break with a KVM error when trying to
> ruin the ppce500 test:
> 
> $ QTEST_QEMU_BINARY=./qemu-system-ppc64 ./tests/qtest/boot-serial-test
> /ppc64/boot-serial/ppce500: qemu-system-ppc64: -accel tcg: invalid accelerator tcg
> error: kvm run failed Invalid argument
> NIP 0000000000f00000   LR 0000000000000000 CTR 0000000000000000 XER 0000000000000000 CPU#0
> MSR 0000000000000000 HID0 0000000000000000  HF 24020002 iidx 1 didx 1
> TB 00000000 00000000 DECR 0
> (...)
> ** (./tests/qtest/boot-serial-test:1935760): ERROR **: 07:44:03.010: Failed to find expected string. Please check '/tmp/qtest-boot-serial-sJ78sqg'
> 
> Fix it by checking CONFIG_TCG before compiling boot-serial-test.
> 
> Cc: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
> ---
>   tests/qtest/meson.build | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
> index 0c2f2d94e1..deed640d7f 100644
> --- a/tests/qtest/meson.build
> +++ b/tests/qtest/meson.build
> @@ -161,7 +161,8 @@ qtests_ppc = \
>     (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +            \
>     (config_all_devices.has_key('CONFIG_M48T59') ? ['m48t59-test'] : []) +                     \
>     (config_all_devices.has_key('CONFIG_TCG') ? ['prom-env-test'] : []) +                      \
> -  ['boot-order-test', 'boot-serial-test']
> +  (config_all_devices.has_key('CONFIG_TCG') ? ['boot-serial-test'] : []) +                   \
> +  ['boot-order-test']
>   
>   qtests_ppc64 = \
>     qtests_ppc + \

Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 5/5] avocado/replay_kernel.py: make tcg-icount check in run_vm()
  2022-03-03 15:35 ` [PATCH 5/5] avocado/replay_kernel.py: make tcg-icount check in run_vm() Daniel Henrique Barboza
@ 2022-03-07  8:47   ` Cédric Le Goater
  2022-03-09  4:59     ` Pavel Dovgalyuk
  0 siblings, 1 reply; 15+ messages in thread
From: Cédric Le Goater @ 2022-03-07  8:47 UTC (permalink / raw)
  To: Daniel Henrique Barboza, qemu-devel
  Cc: thuth, crosa, qemu-ppc, Pavel Dovgalyuk, david

On 3/3/22 16:35, Daniel Henrique Barboza wrote:
> The icount framework relies on TCG availability. If QEMU is built with
> --disable-tcg we won't have icount either, and then this test will fail
> with the following message in an IBM POWER9 host:
> 
> tests/avocado/replay_kernel.py:ReplayKernelNormal.test_ppc64_pseries:
> ERROR: ConnectError: Failed to establish session:
> (...)
> /11-tests_avocado_replay_kernel.py_ReplayKernelNormal.test_ppc64_pseries/replay.bin:
> cannot configure icount, TCG support not available
> 
> Although this was revealed in a specific ppc64 scenario, the TCG check
> is being done in the common code inside run_vm() because all archs need
> TCG to have access to icount.
> 
> Cc: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>


Reviewed-by: Cédric Le Goater <clg@kaod.org>

Pavel,

Should I take this patch through the ppc tree ?

Thanks,

C.


> ---
>   tests/avocado/replay_kernel.py | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/tests/avocado/replay_kernel.py b/tests/avocado/replay_kernel.py
> index c68a953730..0b2b0dc692 100644
> --- a/tests/avocado/replay_kernel.py
> +++ b/tests/avocado/replay_kernel.py
> @@ -36,6 +36,9 @@ class ReplayKernelBase(LinuxKernelTest):
>   
>       def run_vm(self, kernel_path, kernel_command_line, console_pattern,
>                  record, shift, args, replay_path):
> +        # icount requires TCG to be available
> +        self.require_accelerator('tcg')
> +
>           logger = logging.getLogger('replay')
>           start_time = time.time()
>           vm = self.get_vm()
> @@ -243,6 +246,7 @@ def test_ppc64_pseries(self):
>           """
>           :avocado: tags=arch:ppc64
>           :avocado: tags=machine:pseries
> +        :avocado: tags=accel:tcg
>           """
>           kernel_url = ('https://archives.fedoraproject.org/pub/archive'
>                         '/fedora-secondary/releases/29/Everything/ppc64le/os'



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 5/5] avocado/replay_kernel.py: make tcg-icount check in run_vm()
  2022-03-07  8:47   ` Cédric Le Goater
@ 2022-03-09  4:59     ` Pavel Dovgalyuk
  2022-03-09  8:21       ` Cédric Le Goater
  0 siblings, 1 reply; 15+ messages in thread
From: Pavel Dovgalyuk @ 2022-03-09  4:59 UTC (permalink / raw)
  To: Cédric Le Goater, Daniel Henrique Barboza, qemu-devel
  Cc: thuth, crosa, qemu-ppc, Pavel Dovgalyuk, david

On 07.03.2022 11:47, Cédric Le Goater wrote:
> On 3/3/22 16:35, Daniel Henrique Barboza wrote:
>> The icount framework relies on TCG availability. If QEMU is built with
>> --disable-tcg we won't have icount either, and then this test will fail
>> with the following message in an IBM POWER9 host:
>>
>> tests/avocado/replay_kernel.py:ReplayKernelNormal.test_ppc64_pseries:
>> ERROR: ConnectError: Failed to establish session:
>> (...)
>> /11-tests_avocado_replay_kernel.py_ReplayKernelNormal.test_ppc64_pseries/replay.bin: 
>>
>> cannot configure icount, TCG support not available
>>
>> Although this was revealed in a specific ppc64 scenario, the TCG check
>> is being done in the common code inside run_vm() because all archs need
>> TCG to have access to icount.
>>
>> Cc: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
>> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
> 
> 
> Reviewed-by: Cédric Le Goater <clg@kaod.org>
> 
> Pavel,
> 
> Should I take this patch through the ppc tree ?

Nobody has queued it yet, so I think it is ok.

> 
> Thanks,
> 
> C.
> 
> 
>> ---
>>   tests/avocado/replay_kernel.py | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/tests/avocado/replay_kernel.py 
>> b/tests/avocado/replay_kernel.py
>> index c68a953730..0b2b0dc692 100644
>> --- a/tests/avocado/replay_kernel.py
>> +++ b/tests/avocado/replay_kernel.py
>> @@ -36,6 +36,9 @@ class ReplayKernelBase(LinuxKernelTest):
>>       def run_vm(self, kernel_path, kernel_command_line, console_pattern,
>>                  record, shift, args, replay_path):
>> +        # icount requires TCG to be available
>> +        self.require_accelerator('tcg')
>> +
>>           logger = logging.getLogger('replay')
>>           start_time = time.time()
>>           vm = self.get_vm()
>> @@ -243,6 +246,7 @@ def test_ppc64_pseries(self):
>>           """
>>           :avocado: tags=arch:ppc64
>>           :avocado: tags=machine:pseries
>> +        :avocado: tags=accel:tcg
>>           """
>>           kernel_url = ('https://archives.fedoraproject.org/pub/archive'
>>                         
>> '/fedora-secondary/releases/29/Everything/ppc64le/os'
> 



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 5/5] avocado/replay_kernel.py: make tcg-icount check in run_vm()
  2022-03-09  4:59     ` Pavel Dovgalyuk
@ 2022-03-09  8:21       ` Cédric Le Goater
  0 siblings, 0 replies; 15+ messages in thread
From: Cédric Le Goater @ 2022-03-09  8:21 UTC (permalink / raw)
  To: Pavel Dovgalyuk, Daniel Henrique Barboza, qemu-devel
  Cc: thuth, crosa, qemu-ppc, Pavel Dovgalyuk, david

On 3/9/22 05:59, Pavel Dovgalyuk wrote:
> On 07.03.2022 11:47, Cédric Le Goater wrote:
>> On 3/3/22 16:35, Daniel Henrique Barboza wrote:
>>> The icount framework relies on TCG availability. If QEMU is built with
>>> --disable-tcg we won't have icount either, and then this test will fail
>>> with the following message in an IBM POWER9 host:
>>>
>>> tests/avocado/replay_kernel.py:ReplayKernelNormal.test_ppc64_pseries:
>>> ERROR: ConnectError: Failed to establish session:
>>> (...)
>>> /11-tests_avocado_replay_kernel.py_ReplayKernelNormal.test_ppc64_pseries/replay.bin:
>>> cannot configure icount, TCG support not available
>>>
>>> Although this was revealed in a specific ppc64 scenario, the TCG check
>>> is being done in the common code inside run_vm() because all archs need
>>> TCG to have access to icount.
>>>
>>> Cc: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
>>> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
>>
>>
>> Reviewed-by: Cédric Le Goater <clg@kaod.org>
>>
>> Pavel,
>>
>> Should I take this patch through the ppc tree ?
> 
> Nobody has queued it yet, so I think it is ok.

Since these are fixes, I will at end of the week.

Thanks,

C.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 0/5] --disable-tcg qtest/avocado fixes for ppc64
  2022-03-03 15:35 [PATCH 0/5] --disable-tcg qtest/avocado fixes for ppc64 Daniel Henrique Barboza
                   ` (4 preceding siblings ...)
  2022-03-03 15:35 ` [PATCH 5/5] avocado/replay_kernel.py: make tcg-icount check in run_vm() Daniel Henrique Barboza
@ 2022-03-14 15:22 ` Cédric Le Goater
  5 siblings, 0 replies; 15+ messages in thread
From: Cédric Le Goater @ 2022-03-14 15:22 UTC (permalink / raw)
  To: Daniel Henrique Barboza, qemu-devel; +Cc: thuth, crosa, qemu-ppc, david

On 3/3/22 16:35, Daniel Henrique Barboza wrote:
> Hi,
> 
> 'make check' and 'make check-avocado' in a ppc64 host, using a QEMU
> built with --disable-tcg, fails in a handful of tests/files due to the
> lack of TCG support not being accounted for. The tests usually fall back
> to KVM acceleration, and when running in an IBM POWER server this accel
> type isn't able to run any other machine but 'pseries'.
> 
> This series aims to fix it by checking for CONFIG_TCG in
> qtest/meson.build, and using require_accelerator('tcg') in avocado
> tests. I avoided changing the behavior when running the tests in other
> host architectures because I can't assert about how KVM behaves in x86 and
> aarch64. Patches 1, 2 and 4 were limited to ppc/ppc64 tests only because
> of that.
> 
> Patch 5 is something that I am fairly confident that affects all archs
> so the change is made in the common code for everyone.
> 
> 
> Daniel Henrique Barboza (5):
>    qtest/meson.build: check CONFIG_TCG for prom-env-test in qtests_ppc
>    qtest/meson.build: check CONFIG_TCG for boot-serial-test in qtests_ppc
>    avocado/boot_linux_console.py: check for tcg in test_ppc_powernv8/9
>    avocado/boot_linux_console.py: check tcg accel in test_ppc64_e500
>    avocado/replay_kernel.py: make tcg-icount check in run_vm()
> 
>   tests/avocado/boot_linux_console.py | 5 +++++
>   tests/avocado/replay_kernel.py      | 4 ++++
>   tests/qtest/meson.build             | 4 +++-
>   3 files changed, 12 insertions(+), 1 deletion(-)
> 


Queued for 7.0

Thanks,

C.


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-03-14 15:25 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-03 15:35 [PATCH 0/5] --disable-tcg qtest/avocado fixes for ppc64 Daniel Henrique Barboza
2022-03-03 15:35 ` [PATCH 1/5] qtest/meson.build: check CONFIG_TCG for prom-env-test in qtests_ppc Daniel Henrique Barboza
2022-03-07  7:57   ` Thomas Huth
2022-03-03 15:35 ` [PATCH 2/5] qtest/meson.build: check CONFIG_TCG for boot-serial-test " Daniel Henrique Barboza
2022-03-07  8:00   ` Thomas Huth
2022-03-03 15:35 ` [PATCH 3/5] avocado/boot_linux_console.py: check for tcg in test_ppc_powernv8/9 Daniel Henrique Barboza
2022-03-03 16:08   ` Cédric Le Goater
2022-03-04 12:23   ` Philippe Mathieu-Daudé
2022-03-03 15:35 ` [PATCH 4/5] avocado/boot_linux_console.py: check tcg accel in test_ppc64_e500 Daniel Henrique Barboza
2022-03-03 16:08   ` Cédric Le Goater
2022-03-03 15:35 ` [PATCH 5/5] avocado/replay_kernel.py: make tcg-icount check in run_vm() Daniel Henrique Barboza
2022-03-07  8:47   ` Cédric Le Goater
2022-03-09  4:59     ` Pavel Dovgalyuk
2022-03-09  8:21       ` Cédric Le Goater
2022-03-14 15:22 ` [PATCH 0/5] --disable-tcg qtest/avocado fixes for ppc64 Cédric Le Goater

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.