Skip to contentSkip to conversation

s390x, qtest and misc patches for QEMU 8.1 rc1

GIT PULL Applied Thomas Huth 3 participants 11 messages Jul 18, 2023 – Jul 19, 2023

lore
Share & tools
lore
#0 lore raw

The following changes since commit 361d5397355276e3007825cc17217c1e4d4320f7:

Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging (2023-07-17 15:49:27 +0100)

are available in the Git repository at:

https://gitlab.com/thuth/qemu.git tags/pull-request-2023-07-18

for you to fetch changes up to a5754847e0fc2bc08a414dd381803009e8bca390:

tests/avocado: Disable the test_sbsaref_edk2_firmware by default (2023-07-18 11:22:51 +0200)

----------------------------------------------------------------
* Fix s390x KVM guests when compiling with --without-default-devices
* Fix /proc/cpuinfo features list in s390x linux-user emulation
* Generate FreeBSD VM package list via lcitool
* Disable the flaky test_sbsaref_edk2_firmware avocado test by default

----------------------------------------------------------------
Cédric Le Goater (1):

      s390x: Fix QEMU abort by selecting S390_FLIC_KVM

Fabiano Rosas (1):
tests/qtest: Fix typo in multifd cancel test

Ilya Leoshkevich (1):

      linux-user/elfload: Fix /proc/cpuinfo features: on s390x

Philippe Mathieu-Daudé (4):
tests/lcitool: Generate distribution packages list in JSON format tests/lcitool: Refresh generated files
tests/vm: Introduce get_qemu_packages_from_lcitool_json() helper tests/vm/freebsd: Get up-to-date package list from lcitool vars file

Thomas Huth (1):
tests/avocado: Disable the test_sbsaref_edk2_firmware by default

 docs/devel/testing.rst                   |  5 +++
 include/elf.h                            | 66 +++++++++++++++++++--------
 linux-user/elfload.c                     | 41 +++++++++--------
 tests/qtest/migration-test.c             |  2 +-
 hw/intc/Kconfig                          |  1 -
 hw/s390x/Kconfig                         |  1 +
 tests/avocado/machine_aarch64_sbsaref.py |  2 +-
 tests/lcitool/refresh                    | 11 +++++
 tests/vm/basevm.py                       | 11 +++++
 tests/vm/freebsd                         | 42 +----------------
 tests/vm/generated/README                |  5 +++
 tests/vm/generated/freebsd.json          | 77 ++++++++++++++++++++++++++++++++
 12 files changed, 183 insertions(+), 81 deletions(-)
 create mode 100644 tests/vm/generated/README
 create mode 100644 tests/vm/generated/freebsd.json
#1 lore raw

[PULL 3/8] tests/qtest: Fix typo in multifd cancel test

From: Fabiano Rosas <[email protected]>

This wasn't noticed because the test is currently disabled.

Fixes 02f56e3de ("tests/qtest: massively speed up migration-test")

Message-Id: <[email protected]>

---
 tests/qtest/migration-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/migration-test.c +1 -1
index efa8c729db..e256da1216 100644
@@ -2481,7 +2481,7 @@ static void test_multifd_tcp_cancel(void)
 
     migrate_qmp(from, uri, "{}");
 
-    migrate_wait_for_dirty_mem(from, to);
+    migrate_wait_for_dirty_mem(from, to2);
 
     migrate_ensure_converge(from);
 
Signature · 1 line
2.39.3
#2 lore raw

[PULL 8/8] tests/avocado: Disable the test_sbsaref_edk2_firmware by default

In reply to Thomas Huth

The test fails occasionally, see e.g.:

https://gitlab.com/thuth/qemu/-/jobs/4196177756#L489
https://gitlab.com/thuth/qemu/-/jobs/4623296271#L290

It also fails on my laptop in ca. 50% of all runs. Thus disable it by default by using the QEMU_TEST_FLAKY_TESTS environment variable to fence it (which we also already use in flaky qtests). While we're at it, also document this variable in docs/devel/testing.rst.

Message-Id: <[email protected]>

---
 docs/devel/testing.rst                   | 5 +++++
 tests/avocado/machine_aarch64_sbsaref.py | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
docs/devel/testing.rst +5 -0
index fb651eae11..b6ad21bed1 100644
@@ -1384,6 +1384,11 @@ variable as shown on the code snippet below to skip the test:
   def test(self):
       do_something()
 
+QEMU_TEST_FLAKY_TESTS
+^^^^^^^^^^^^^^^^^^^^^
+Some tests are not working reliably and thus are disabled by default.
+Set this environment variable to enable them.
+
 Uninstalling Avocado
 ~~~~~~~~~~~~~~~~~~~~
 
tests/avocado/machine_aarch64_sbsaref.py +1 -1
index cce6ef9f65..a794245e7e 100644
@@ -8,7 +8,6 @@
 
 import os
 
-from avocado import skip
 from avocado import skipUnless
 from avocado.utils import archive
 
@@ -76,6 +75,7 @@ def fetch_firmware(self):
             "sbsa-ref",
         )
 
+    @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test is not reliable')
     def test_sbsaref_edk2_firmware(self):
         """
         :avocado: tags=cpu:cortex-a57
Signature · 1 line
2.39.3
#3 lore raw

[PULL 7/8] tests/vm/freebsd: Get up-to-date package list from lcitool vars file

In reply to Thomas Huth

From: Philippe Mathieu-Daudé <[email protected]>

Get an up-to-date package list from lcitool, that way we don't need to manually keep this array in sync.

Message-Id: <[email protected]>

---
 tests/vm/freebsd | 42 ++----------------------------------------
 1 file changed, 2 insertions(+), 40 deletions(-)
tests/vm/freebsd +2 -40
index 11de6473f4..ac51376c82 100755
@@ -31,45 +31,6 @@ class FreeBSDVM(basevm.BaseVM):
     link = "https://download.freebsd.org/releases/CI-IMAGES/13.2-RELEASE/amd64/Latest/FreeBSD-13.2-RELEASE-amd64-BASIC-CI.raw.xz"
     csum = "a4fb3b6c7b75dd4d58fb0d75e4caf72844bffe0ca00e66459c028b198ffb3c0e"
     size = "20G"
-    pkgs = [
-        # build tools
-        "git",
-        "pkgconf",
-        "bzip2",
-        "python39",
-        "ninja",
-
-        # gnu tools
-        "bash",
-        "gmake",
-        "gsed",
-        "gettext",
-
-        # libs: crypto
-        "gnutls",
-
-        # libs: images
-        "jpeg-turbo",
-        "png",
-
-        # libs: ui
-        "sdl2",
-        "gtk3",
-        "libxkbcommon",
-
-        # libs: opengl
-        "libepoxy",
-        "mesa-libs",
-
-        # libs: migration
-        "zstd",
-
-        # libs: networking
-        "libslirp",
-
-        # libs: sndio
-        "sndio",
-    ]
 
     BUILD_SCRIPT = """
         set -e;
@@ -151,8 +112,9 @@ class FreeBSDVM(basevm.BaseVM):
         self.console_wait(prompt)
         self.console_send("echo 'chmod 666 /dev/vtbd1' >> /etc/rc.local\n")
 
+        pkgs = self.get_qemu_packages_from_lcitool_json()
         self.print_step("Installing packages")
-        self.ssh_root_check("pkg install -y %s\n" % " ".join(self.pkgs))
+        self.ssh_root_check("pkg install -y %s\n" % " ".join(pkgs))
 
         # shutdown
         self.ssh_root(self.poweroff)
Signature · 1 line
2.39.3
#4 lore raw

[PULL 6/8] tests/vm: Introduce get_qemu_packages_from_lcitool_json() helper

In reply to Thomas Huth

From: Philippe Mathieu-Daudé <[email protected]>

Add the get_qemu_packages_from_lcitool_json() helper which return such package list from a lcitool env var file in JSON format.

Message-Id: <[email protected]>

---
 tests/vm/basevm.py | 11 +++++++++++
 1 file changed, 11 insertions(+)
tests/vm/basevm.py +11 -0
index 23229e23d1..a97e23b0ce 100644
@@ -27,6 +27,7 @@
 import multiprocessing
 import traceback
 import shlex
+import json
 
 from qemu.machine import QEMUMachine
 from qemu.utils import get_info_usernet_hostfwd_port, kvm_available
@@ -501,6 +502,16 @@ def gen_cloud_init_iso(self):
                               stderr=self._stdout)
         return os.path.join(cidir, "cloud-init.iso")
 
+    def get_qemu_packages_from_lcitool_json(self, json_path=None):
+        """Parse a lcitool variables json file and return the PKGS list."""
+        if json_path is None:
+            json_path = os.path.join(
+                os.path.dirname(__file__), "generated", self.name + ".json"
+            )
+        with open(json_path, "r") as fh:
+            return json.load(fh)["pkgs"]
+
+
 def get_qemu_path(arch, build_path=None):
     """Fetch the path to the qemu binary."""
     # If QEMU environment variable set, it takes precedence
Signature · 1 line
2.39.3
#5 lore raw

[PULL 1/8] s390x: Fix QEMU abort by selecting S390_FLIC_KVM

In reply to Thomas Huth

From: Cédric Le Goater <[email protected]>

If QEMU is built with --without-default-devices, the s390-flic-kvm device is missing and QEMU aborts when started with the KVM accelerator. Make sure it's available by selecting S390_FLIC_KVM in Kconfig.

Consequently, this also fixes an abort in tests/qtest/migration-test.

Message-Id: <[email protected]>

---
 hw/intc/Kconfig  | 1 -
 hw/s390x/Kconfig | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)
hw/intc/Kconfig +0 -1
index 21441d0a0c..97d550b06b 100644
@@ -49,7 +49,6 @@ config S390_FLIC
 
 config S390_FLIC_KVM
     bool
-    default y
     depends on S390_FLIC && KVM
 
 config OMPIC
hw/s390x/Kconfig +1 -0
index e8d4d68ece..4c068d7960 100644
@@ -8,6 +8,7 @@ config S390_CCW_VIRTIO
     imply PCIE_DEVICES
     select PCI_EXPRESS
     select S390_FLIC
+    select S390_FLIC_KVM if KVM
     select SCLPCONSOLE
     select VIRTIO_CCW
     select MSI_NONBROKEN
Signature · 1 line
2.39.3
#6 lore raw

[PULL 5/8] tests/lcitool: Refresh generated files

In reply to Thomas Huth

From: Philippe Mathieu-Daudé <[email protected]>

Refresh the generated files by running:

  $ make lcitool-refresh

Message-Id: <[email protected]>

[thuth: Drop changes to libpmem-dev and libxen-dev]
---
 tests/vm/generated/freebsd.json | 77 +++++++++++++++++++++++++++++++++
 1 file changed, 77 insertions(+)
 create mode 100644 tests/vm/generated/freebsd.json
tests/vm/generated/freebsd.json new file +77 -0
new file mode 100644
index 0000000000..7c435cf23e
@@ -0,0 +1,77 @@
+{
+  "ccache": "/usr/local/bin/ccache",
+  "cpan_pkgs": [],
+  "cross_pkgs": [],
+  "make": "/usr/local/bin/gmake",
+  "ninja": "/usr/local/bin/ninja",
+  "packaging_command": "pkg",
+  "pip3": "/usr/local/bin/pip-3.8",
+  "pkgs": [
+    "alsa-lib",
+    "bash",
+    "bison",
+    "bzip2",
+    "ca_root_nss",
+    "capstone4",
+    "ccache",
+    "cmocka",
+    "ctags",
+    "curl",
+    "cyrus-sasl",
+    "dbus",
+    "diffutils",
+    "dtc",
+    "flex",
+    "fusefs-libs3",
+    "gettext",
+    "git",
+    "glib",
+    "gmake",
+    "gnutls",
+    "gsed",
+    "gtk3",
+    "json-c",
+    "libepoxy",
+    "libffi",
+    "libgcrypt",
+    "libjpeg-turbo",
+    "libnfs",
+    "libslirp",
+    "libspice-server",
+    "libssh",
+    "libtasn1",
+    "llvm",
+    "lzo2",
+    "meson",
+    "mtools",
+    "ncurses",
+    "nettle",
+    "ninja",
+    "opencv",
+    "pixman",
+    "pkgconf",
+    "png",
+    "py39-numpy",
+    "py39-pillow",
+    "py39-pip",
+    "py39-sphinx",
+    "py39-sphinx_rtd_theme",
+    "py39-yaml",
+    "python3",
+    "rpm2cpio",
+    "sdl2",
+    "sdl2_image",
+    "snappy",
+    "sndio",
+    "socat",
+    "spice-protocol",
+    "tesseract",
+    "usbredir",
+    "virglrenderer",
+    "vte3",
+    "xorriso",
+    "zstd"
+  ],
+  "pypi_pkgs": [],
+  "python": "/usr/local/bin/python3"
+}
Signature · 1 line
2.39.3
#7 lore raw

[PULL 2/8] linux-user/elfload: Fix /proc/cpuinfo features: on s390x

In reply to Thomas Huth

From: Ilya Leoshkevich <[email protected]>

elf_hwcap_str() takes a bit number, but compares it for equality with the HWCAP_S390_* masks. This causes /proc/cpuinfo to display incorrect hwcaps.

Fix by introducing the HWCAP_S390_NR_* constants and using them in elf_hwcap_str() instead of the HWCAP_S390_*. While at it, add the missing nnpa, pcimio and sie hwcaps from the latest kernel.

Output before:

features : esan3 zarch stfle msa

Output after:

features : esan3 zarch stfle msa ldisp eimm etf3eh highgprs vx vxe

Fixes e19807bee357 ("linux-user/elfload: Introduce elf_hwcap_str() on s390x")

Message-Id: <[email protected]>

---
 include/elf.h        | 66 +++++++++++++++++++++++++++++++-------------
 linux-user/elfload.c | 41 ++++++++++++++-------------
 2 files changed, 69 insertions(+), 38 deletions(-)
include/elf.h +47 -19
index 2f4d0e56d1..ec9755e73b 100644
@@ -596,25 +596,53 @@ typedef struct {
 
 /* Bits present in AT_HWCAP for s390.  */
 
-#define HWCAP_S390_ESAN3        1
-#define HWCAP_S390_ZARCH        2
-#define HWCAP_S390_STFLE        4
-#define HWCAP_S390_MSA          8
-#define HWCAP_S390_LDISP        16
-#define HWCAP_S390_EIMM         32
-#define HWCAP_S390_DFP          64
-#define HWCAP_S390_HPAGE        128
-#define HWCAP_S390_ETF3EH       256
-#define HWCAP_S390_HIGH_GPRS    512
-#define HWCAP_S390_TE           1024
-#define HWCAP_S390_VXRS         2048
-#define HWCAP_S390_VXRS_BCD     4096
-#define HWCAP_S390_VXRS_EXT     8192
-#define HWCAP_S390_GS           16384
-#define HWCAP_S390_VXRS_EXT2    32768
-#define HWCAP_S390_VXRS_PDE     65536
-#define HWCAP_S390_SORT         131072
-#define HWCAP_S390_DFLT         262144
+#define HWCAP_S390_NR_ESAN3      0
+#define HWCAP_S390_NR_ZARCH      1
+#define HWCAP_S390_NR_STFLE      2
+#define HWCAP_S390_NR_MSA        3
+#define HWCAP_S390_NR_LDISP      4
+#define HWCAP_S390_NR_EIMM       5
+#define HWCAP_S390_NR_DFP        6
+#define HWCAP_S390_NR_HPAGE      7
+#define HWCAP_S390_NR_ETF3EH     8
+#define HWCAP_S390_NR_HIGH_GPRS  9
+#define HWCAP_S390_NR_TE        10
+#define HWCAP_S390_NR_VXRS      11
+#define HWCAP_S390_NR_VXRS_BCD  12
+#define HWCAP_S390_NR_VXRS_EXT  13
+#define HWCAP_S390_NR_GS        14
+#define HWCAP_S390_NR_VXRS_EXT2 15
+#define HWCAP_S390_NR_VXRS_PDE  16
+#define HWCAP_S390_NR_SORT      17
+#define HWCAP_S390_NR_DFLT      18
+#define HWCAP_S390_NR_VXRS_PDE2 19
+#define HWCAP_S390_NR_NNPA      20
+#define HWCAP_S390_NR_PCI_MIO   21
+#define HWCAP_S390_NR_SIE       22
+
+#define HWCAP_S390_ESAN3     (1 << HWCAP_S390_NR_ESAN3)
+#define HWCAP_S390_ZARCH     (1 << HWCAP_S390_NR_ZARCH)
+#define HWCAP_S390_STFLE     (1 << HWCAP_S390_NR_STFLE)
+#define HWCAP_S390_MSA       (1 << HWCAP_S390_NR_MSA)
+#define HWCAP_S390_LDISP     (1 << HWCAP_S390_NR_LDISP)
+#define HWCAP_S390_EIMM      (1 << HWCAP_S390_NR_EIMM)
+#define HWCAP_S390_DFP       (1 << HWCAP_S390_NR_DFP)
+#define HWCAP_S390_HPAGE     (1 << HWCAP_S390_NR_HPAGE)
+#define HWCAP_S390_ETF3EH    (1 << HWCAP_S390_NR_ETF3EH)
+#define HWCAP_S390_HIGH_GPRS (1 << HWCAP_S390_NR_HIGH_GPRS)
+#define HWCAP_S390_TE        (1 << HWCAP_S390_NR_TE)
+#define HWCAP_S390_VXRS      (1 << HWCAP_S390_NR_VXRS)
+#define HWCAP_S390_VXRS_BCD  (1 << HWCAP_S390_NR_VXRS_BCD)
+#define HWCAP_S390_VXRS_EXT  (1 << HWCAP_S390_NR_VXRS_EXT)
+#define HWCAP_S390_GS        (1 << HWCAP_S390_NR_GS)
+#define HWCAP_S390_VXRS_EXT2 (1 << HWCAP_S390_NR_VXRS_EXT2)
+#define HWCAP_S390_VXRS_PDE  (1 << HWCAP_S390_NR_VXRS_PDE)
+#define HWCAP_S390_SORT      (1 << HWCAP_S390_NR_SORT)
+#define HWCAP_S390_DFLT      (1 << HWCAP_S390_NR_DFLT)
+#define HWCAP_S390_VXRS_PDE2 (1 << HWCAP_S390_NR_VXRS_PDE2)
+#define HWCAP_S390_NNPA      (1 << HWCAP_S390_NR_NNPA)
+#define HWCAP_S390_PCI_MIO   (1 << HWCAP_S390_NR_PCI_MIO)
+#define HWCAP_S390_SIE       (1 << HWCAP_S390_NR_SIE)
 
 /* M68K specific definitions. */
 /* We use the top 24 bits to encode information about the
linux-user/elfload.c +22 -19

47 lines not on this page · raw message

Signature · 1 line
2.39.3
#8 lore raw

[PULL 4/8] tests/lcitool: Generate distribution packages list in JSON format

In reply to Thomas Huth

From: Philippe Mathieu-Daudé <[email protected]>

Add the generate_pkglist() helper to generate a list of packages required by a distribution to build QEMU.

Since we can not add a "THIS FILE WAS AUTO-GENERATED" comment in JSON, create the files under tests/vm/generated/ sub-directory; add a README mentioning the files are generated.

Message-Id: <[email protected]>

---
 tests/lcitool/refresh     | 11 +++++++++++
 tests/vm/generated/README |  5 +++++
 2 files changed, 16 insertions(+)
 create mode 100644 tests/vm/generated/README
tests/lcitool/refresh +11 -0
index b54566edcc..4584870ea1 100755
@@ -84,6 +84,12 @@ def generate_cirrus(target, trailer=None):
     generate(filename, cmd, trailer)
 
 
+def generate_pkglist(vm, target):
+    filename = Path(src_dir, "tests", "vm", "generated", vm + ".json")
+    cmd = lcitool_cmd + ["variables", "--format", "json", target, "qemu"]
+    generate(filename, cmd, None)
+
+
 # Netmap still needs to be manually built as it is yet to be packaged
 # into a distro. We also add cscope and gtags which are used in the CI
 # test
@@ -191,6 +197,11 @@ try:
     generate_cirrus("freebsd-13")
     generate_cirrus("macos-12")
 
+    #
+    # VM packages lists
+    #
+    generate_pkglist("freebsd", "freebsd-13")
+
     sys.exit(0)
 except Exception as ex:
     print(str(ex), file=sys.stderr)
tests/vm/generated/README new file +5 -0
new file mode 100644
index 0000000000..7ccc6ffd3d
@@ -0,0 +1,5 @@
+# FILES IN THIS FOLDER WERE AUTO-GENERATED
+#
+#  $ make lcitool-refresh
+#
+# https://gitlab.com/libvirt/libvirt-ci
Signature · 1 line
2.39.3
#9 lore raw
In reply to Thomas Huth
Quoted 11 lines · Thomas Huth

The following changes since commit 361d5397355276e3007825cc17217c1e4d4320f7:

Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging (2023-07-17 15:49:27 +0100)

are available in the Git repository at:

https://gitlab.com/thuth/qemu.git tags/pull-request-2023-07-18

for you to fetch changes up to a5754847e0fc2bc08a414dd381803009e8bca390:

Quoted 8 lines

tests/avocado: Disable the test_sbsaref_edk2_firmware by default (2023-07-18 11:22:51 +0200)

----------------------------------------------------------------
* Fix s390x KVM guests when compiling with --without-default-devices
* Fix /proc/cpuinfo features list in s390x linux-user emulation
* Generate FreeBSD VM package list via lcitool
* Disable the flaky test_sbsaref_edk2_firmware avocado test by default

Applied to target-arm.next, thanks.

-- PMM

#10 lore raw
Quoted 23 lines · Peter Maydell
Quoted 11 lines · Thomas Huth

The following changes since commit 361d5397355276e3007825cc17217c1e4d4320f7:

   Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging (2023-07-17 15:49:27 +0100)

are available in the Git repository at:

   https://gitlab.com/thuth/qemu.git tags/pull-request-2023-07-18

for you to fetch changes up to a5754847e0fc2bc08a414dd381803009e8bca390:

Quoted 8 lines
   tests/avocado: Disable the test_sbsaref_edk2_firmware by default (2023-07-18 11:22:51 +0200)

----------------------------------------------------------------
* Fix s390x KVM guests when compiling with --without-default-devices
* Fix /proc/cpuinfo features list in s390x linux-user emulation
* Generate FreeBSD VM package list via lcitool
* Disable the flaky test_sbsaref_edk2_firmware avocado test by default

Quoted 1 line

Applied to target-arm.next, thanks.

s/target-arm.next/master/ ;)