* 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
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmS2W14RHHRodXRoQHJl
 ZGhhdC5jb20ACgkQLtnXdP5wLbW25g/7B68fy5dMzrrYlESm/PSYKa+POZtXt7IO
 EuDNgqIz8bBtlK/4HgMiY0huoT+5cWJ73qZeSzoiDjte8CqOAfjy2TeOWEpd+1qZ
 xHZ7W1t1fwN2rNQlOlGw4jASkrwdYeiBbD8PopixKeevwMOOAxroYNHSvzPNG+Qa
 rTJAlzq1Q80z8DP5zl6ufsxQNiWQsCdCO3hdTZQsRi+RCxl+3SMx2xKA2bBtw9VL
 skwItYqvvw21LtR7yYhnb9bMtikh+nVYuyAW6CJl9vrG2zwf6D/tURIk4LLaIxlS
 XfDVRul6BJHWWdWAZ42Q7Xwe0olrzOfl57wYb/gvh09E6NEjyJcyIr/mor+yz1/q
 Qomb/Stt5K8pphiSSwkKmZUGA0s96MjOYe/xXbJegu+6X6HNgYVobZDMMq/BABy2
 XeESwUE/Hfz+VW14oqCk4edZb6+jQbYaKO/YDPd7uyXzfas079koWYfWx9Ew08U8
 f5h7achjECr3R4DJ9VgYIOKJuv37LcnwbePspXdRK5pjRrqr9FD9XsEg4gF7rbIe
 A/g/UUx1+AXeie4z1MrUwFhOrqV1g5t34cBR9iqZtISd0UiNk6ExoiX8i+ELaw5+
 ADirr46HJFS9jVAKKw9zym932qC92AQNH0d0iOYv3AHzvKvTDiQOXHyl1bLTMeYd
 yUJNn+Jkdns=
 =dw94
 -----END PGP SIGNATURE-----

Merge tag 'pull-request-2023-07-18' of https://gitlab.com/thuth/qemu into staging

* 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

# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmS2W14RHHRodXRoQHJl
# ZGhhdC5jb20ACgkQLtnXdP5wLbW25g/7B68fy5dMzrrYlESm/PSYKa+POZtXt7IO
# EuDNgqIz8bBtlK/4HgMiY0huoT+5cWJ73qZeSzoiDjte8CqOAfjy2TeOWEpd+1qZ
# xHZ7W1t1fwN2rNQlOlGw4jASkrwdYeiBbD8PopixKeevwMOOAxroYNHSvzPNG+Qa
# rTJAlzq1Q80z8DP5zl6ufsxQNiWQsCdCO3hdTZQsRi+RCxl+3SMx2xKA2bBtw9VL
# skwItYqvvw21LtR7yYhnb9bMtikh+nVYuyAW6CJl9vrG2zwf6D/tURIk4LLaIxlS
# XfDVRul6BJHWWdWAZ42Q7Xwe0olrzOfl57wYb/gvh09E6NEjyJcyIr/mor+yz1/q
# Qomb/Stt5K8pphiSSwkKmZUGA0s96MjOYe/xXbJegu+6X6HNgYVobZDMMq/BABy2
# XeESwUE/Hfz+VW14oqCk4edZb6+jQbYaKO/YDPd7uyXzfas079koWYfWx9Ew08U8
# f5h7achjECr3R4DJ9VgYIOKJuv37LcnwbePspXdRK5pjRrqr9FD9XsEg4gF7rbIe
# A/g/UUx1+AXeie4z1MrUwFhOrqV1g5t34cBR9iqZtISd0UiNk6ExoiX8i+ELaw5+
# ADirr46HJFS9jVAKKw9zym932qC92AQNH0d0iOYv3AHzvKvTDiQOXHyl1bLTMeYd
# yUJNn+Jkdns=
# =dw94
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 18 Jul 2023 10:29:02 BST
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* tag 'pull-request-2023-07-18' of https://gitlab.com/thuth/qemu:
  tests/avocado: Disable the test_sbsaref_edk2_firmware by default
  tests/vm/freebsd: Get up-to-date package list from lcitool vars file
  tests/vm: Introduce get_qemu_packages_from_lcitool_json() helper
  tests/lcitool: Refresh generated files
  tests/lcitool: Generate distribution packages list in JSON format
  tests/qtest: Fix typo in multifd cancel test
  linux-user/elfload: Fix /proc/cpuinfo features: on s390x
  s390x: Fix QEMU abort by selecting S390_FLIC_KVM

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2023-07-19 09:43:38 +01:00
commit 7a0adc3e05
12 changed files with 183 additions and 81 deletions

View file

@ -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
~~~~~~~~~~~~~~~~~~~~

View file

@ -49,7 +49,6 @@ config S390_FLIC
config S390_FLIC_KVM
bool
default y
depends on S390_FLIC && KVM
config OMPIC

View file

@ -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

View file

@ -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

View file

@ -1621,25 +1621,28 @@ uint32_t get_elf_hwcap(void)
const char *elf_hwcap_str(uint32_t bit)
{
static const char *hwcap_str[] = {
[HWCAP_S390_ESAN3] = "esan3",
[HWCAP_S390_ZARCH] = "zarch",
[HWCAP_S390_STFLE] = "stfle",
[HWCAP_S390_MSA] = "msa",
[HWCAP_S390_LDISP] = "ldisp",
[HWCAP_S390_EIMM] = "eimm",
[HWCAP_S390_DFP] = "dfp",
[HWCAP_S390_HPAGE] = "edat",
[HWCAP_S390_ETF3EH] = "etf3eh",
[HWCAP_S390_HIGH_GPRS] = "highgprs",
[HWCAP_S390_TE] = "te",
[HWCAP_S390_VXRS] = "vx",
[HWCAP_S390_VXRS_BCD] = "vxd",
[HWCAP_S390_VXRS_EXT] = "vxe",
[HWCAP_S390_GS] = "gs",
[HWCAP_S390_VXRS_EXT2] = "vxe2",
[HWCAP_S390_VXRS_PDE] = "vxp",
[HWCAP_S390_SORT] = "sort",
[HWCAP_S390_DFLT] = "dflt",
[HWCAP_S390_NR_ESAN3] = "esan3",
[HWCAP_S390_NR_ZARCH] = "zarch",
[HWCAP_S390_NR_STFLE] = "stfle",
[HWCAP_S390_NR_MSA] = "msa",
[HWCAP_S390_NR_LDISP] = "ldisp",
[HWCAP_S390_NR_EIMM] = "eimm",
[HWCAP_S390_NR_DFP] = "dfp",
[HWCAP_S390_NR_HPAGE] = "edat",
[HWCAP_S390_NR_ETF3EH] = "etf3eh",
[HWCAP_S390_NR_HIGH_GPRS] = "highgprs",
[HWCAP_S390_NR_TE] = "te",
[HWCAP_S390_NR_VXRS] = "vx",
[HWCAP_S390_NR_VXRS_BCD] = "vxd",
[HWCAP_S390_NR_VXRS_EXT] = "vxe",
[HWCAP_S390_NR_GS] = "gs",
[HWCAP_S390_NR_VXRS_EXT2] = "vxe2",
[HWCAP_S390_NR_VXRS_PDE] = "vxp",
[HWCAP_S390_NR_SORT] = "sort",
[HWCAP_S390_NR_DFLT] = "dflt",
[HWCAP_S390_NR_NNPA] = "nnpa",
[HWCAP_S390_NR_PCI_MIO] = "pcimio",
[HWCAP_S390_NR_SIE] = "sie",
};
return bit < ARRAY_SIZE(hwcap_str) ? hwcap_str[bit] : NULL;

View file

@ -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

View file

@ -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)

View file

@ -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);

View file

@ -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

View file

@ -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)

View file

@ -0,0 +1,5 @@
# FILES IN THIS FOLDER WERE AUTO-GENERATED
#
# $ make lcitool-refresh
#
# https://gitlab.com/libvirt/libvirt-ci

View file

@ -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"
}