* [PULL 01/18] tests/requirements.txt: bump up avocado-framework version to 101.0
2023-04-27 15:44 [PULL 00/18] testing and doc updates Alex Bennée
@ 2023-04-27 15:44 ` Alex Bennée
2023-04-27 15:44 ` [PULL 02/18] tests/avocado: use the new snapshots for testing Alex Bennée
` (18 subsequent siblings)
19 siblings, 0 replies; 26+ messages in thread
From: Alex Bennée @ 2023-04-27 15:44 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, Kautuk Consul, Hariharan T S, Thomas Huth,
Alex Bennée, Paolo Bonzini
From: Kautuk Consul <kconsul@linux.vnet.ibm.com>
Avocado version 101.0 has a fix to re-compute the checksum
of an asset file if the algorithm used in the *-CHECKSUM
file isn't the same as the one being passed to it by the
avocado user (i.e. the avocado_qemu python module).
In the earlier avocado versions this fix wasn't there due
to which if the checksum wouldn't match the earlier
checksum (calculated by a different algorithm), the avocado
code would start downloading a fresh image from the internet
URL thus making the test-cases take longer to execute.
Bump up the avocado-framework version to 101.0.
Signed-off-by: Kautuk Consul <kconsul@linux.vnet.ibm.com>
Tested-by: Hariharan T S <hariharan.ts@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230327115030.3418323-2-kconsul@linux.vnet.ibm.com>
Message-Id: <20230424092249.58552-2-alex.bennee@linaro.org>
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 9422ddaece..a4de0ad5a2 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -138,14 +138,18 @@ get-vm-image-fedora-31-%: check-venv
# download all vm images, according to defined targets
get-vm-images: check-venv $(patsubst %,get-vm-image-fedora-31-%, $(FEDORA_31_DOWNLOAD))
+JOBS_OPTION=$(lastword -j1 $(filter-out -j, $(filter -j%,$(MAKEFLAGS))))
+
check-avocado: check-venv $(TESTS_RESULTS_DIR) get-vm-images
- $(call quiet-command, \
- $(TESTS_PYTHON) -m avocado \
- --show=$(AVOCADO_SHOW) run --job-results-dir=$(TESTS_RESULTS_DIR) \
- $(if $(AVOCADO_TAGS),, --filter-by-tags-include-empty \
- --filter-by-tags-include-empty-key) \
- $(AVOCADO_CMDLINE_TAGS) \
- $(if $(GITLAB_CI),,--failfast) $(AVOCADO_TESTS), \
+ $(call quiet-command, \
+ $(TESTS_PYTHON) -m avocado \
+ --show=$(AVOCADO_SHOW) run --job-results-dir=$(TESTS_RESULTS_DIR) \
+ $(if $(AVOCADO_TAGS),, \
+ --filter-by-tags-include-empty \
+ --filter-by-tags-include-empty-key) \
+ --max-parallel-tasks $(JOBS_OPTION:-j%=%) \
+ $(AVOCADO_CMDLINE_TAGS) \
+ $(if $(GITLAB_CI),,--failfast) $(AVOCADO_TESTS), \
"AVOCADO", "tests/avocado")
check-acceptance-deprecated-warning:
diff --git a/tests/requirements.txt b/tests/requirements.txt
index 0ba561b6bd..a6f73da681 100644
--- a/tests/requirements.txt
+++ b/tests/requirements.txt
@@ -2,5 +2,5 @@
# in the tests/venv Python virtual environment. For more info,
# refer to: https://pip.pypa.io/en/stable/user_guide/#id1
# Note that qemu.git/python/ is always implicitly installed.
-avocado-framework==88.1
+avocado-framework==101.0
pycdlib==1.11.0
--
2.39.2
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PULL 02/18] tests/avocado: use the new snapshots for testing
2023-04-27 15:44 [PULL 00/18] testing and doc updates Alex Bennée
2023-04-27 15:44 ` [PULL 01/18] tests/requirements.txt: bump up avocado-framework version to 101.0 Alex Bennée
@ 2023-04-27 15:44 ` Alex Bennée
2023-04-28 12:08 ` Thomas Huth
2023-04-27 15:44 ` [PULL 03/18] tests/avocado: Add set of boot tests on SBSA-ref Alex Bennée
` (17 subsequent siblings)
19 siblings, 1 reply; 26+ messages in thread
From: Alex Bennée @ 2023-04-27 15:44 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, Alex Bennée, Thomas Huth,
Philippe Mathieu-Daudé, Wainer dos Santos Moschetta,
Beraldo Leal, Cleber Rosa
The tuxboot images now have a stable snapshot URL so we can enable the
checksums and remove the avocado warnings. We will have to update as
old snapshots retire but that won't be too frequent.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Acked-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20230424092249.58552-3-alex.bennee@linaro.org>
diff --git a/tests/avocado/tuxrun_baselines.py b/tests/avocado/tuxrun_baselines.py
index d343376faa..e8749717e9 100644
--- a/tests/avocado/tuxrun_baselines.py
+++ b/tests/avocado/tuxrun_baselines.py
@@ -77,20 +77,33 @@ def wait_for_console_pattern(self, success_message, vm=None):
failure_message='Kernel panic - not syncing',
vm=vm)
- def fetch_tuxrun_assets(self, dt=None):
+ def fetch_tuxrun_assets(self, csums=None, dt=None):
"""
Fetch the TuxBoot assets. They are stored in a standard way so we
use the per-test tags to fetch details.
"""
- base_url = f"https://storage.tuxboot.com/{self.tuxboot}/"
- kernel_image = self.fetch_asset(base_url + self.image)
- disk_image_zst = self.fetch_asset(base_url + "rootfs.ext4.zst")
+ base_url = f"https://storage.tuxboot.com/20230331/{self.tuxboot}/"
+
+ # empty hash if we weren't passed one
+ csums = {} if csums is None else csums
+ ksum = csums.get(self.image, None)
+ isum = csums.get("rootfs.ext4.zst", None)
+
+ kernel_image = self.fetch_asset(base_url + self.image,
+ asset_hash = ksum,
+ algorithm = "sha256")
+ disk_image_zst = self.fetch_asset(base_url + "rootfs.ext4.zst",
+ asset_hash = isum,
+ algorithm = "sha256")
cmd = f"{self.zstd} -d {disk_image_zst} -o {self.workdir}/rootfs.ext4"
process.run(cmd)
if dt:
- dtb = self.fetch_asset(base_url + dt)
+ dsum = csums.get(dt, None)
+ dtb = self.fetch_asset(base_url + dt,
+ asset_hash = dsum,
+ algorithm = "sha256")
else:
dtb = None
@@ -149,7 +162,9 @@ def run_tuxtest_tests(self, haltmsg):
else:
self.vm.wait()
- def common_tuxrun(self, dt=None,
+ def common_tuxrun(self,
+ csums=None,
+ dt=None,
drive="virtio-blk-device",
haltmsg="reboot: System halted",
console_index=0):
@@ -158,7 +173,7 @@ def common_tuxrun(self, dt=None,
special with the command line we can process most things using
the tag metadata.
"""
- (kernel, disk, dtb) = self.fetch_tuxrun_assets(dt)
+ (kernel, disk, dtb) = self.fetch_tuxrun_assets(csums, dt)
self.prepare_run(kernel, disk, drive, dtb, console_index)
self.vm.launch()
@@ -182,7 +197,11 @@ def test_arm64(self):
:avocado: tags=console:ttyAMA0
:avocado: tags=shutdown:nowait
"""
- self.common_tuxrun()
+ sums = {"Image" :
+ "ce95a7101a5fecebe0fe630deee6bd97b32ba41bc8754090e9ad8961ea8674c7",
+ "rootfs.ext4.zst" :
+ "bbd5ed4b9c7d3f4ca19ba71a323a843c6b585e880115df3b7765769dbd9dd061"}
+ self.common_tuxrun(csums=sums)
def test_arm64be(self):
"""
@@ -194,7 +213,11 @@ def test_arm64be(self):
:avocado: tags=console:ttyAMA0
:avocado: tags=shutdown:nowait
"""
- self.common_tuxrun()
+ sums = { "Image" :
+ "e0df4425eb2cd9ea9a283e808037f805641c65d8fcecc8f6407d8f4f339561b4",
+ "rootfs.ext4.zst" :
+ "e6ffd8813c8a335bc15728f2835f90539c84be7f8f5f691a8b01451b47fb4bd7"}
+ self.common_tuxrun(csums=sums)
def test_armv5(self):
"""
@@ -206,7 +229,15 @@ def test_armv5(self):
:avocado: tags=console:ttyAMA0
:avocado: tags=shutdown:nowait
"""
- self.common_tuxrun(drive="virtio-blk-pci",
+ sums = { "rootfs.ext4.zst" :
+ "17177afa74e7294da0642861f08c88ca3c836764299a54bf6d1ce276cb9712a5",
+ "versatile-pb.dtb" :
+ "0bc0c0b0858cefd3c32b385c0d66d97142ded29472a496f4f490e42fc7615b25",
+ "zImage" :
+ "c95af2f27647c12265d75e9df44c22ff5228c59855f54aaa70f41ec2842e3a4d" }
+
+ self.common_tuxrun(csums=sums,
+ drive="virtio-blk-pci",
dt="versatile-pb.dtb")
def test_armv7(self):
@@ -219,7 +250,12 @@ def test_armv7(self):
:avocado: tags=console:ttyAMA0
:avocado: tags=shutdown:nowait
"""
- self.common_tuxrun()
+ sums = { "rootfs.ext4.zst" :
+ "ab1fbbeaddda1ffdd45c9405a28cd5370c20f23a7cbc809cc90dc9f243a8eb5a",
+ "zImage" :
+ "4c7a22e9f15875bec06bd2a29d822496571eb297d4f22694099ffcdb19077572" }
+
+ self.common_tuxrun(csums=sums)
def test_armv7be(self):
"""
@@ -232,7 +268,12 @@ def test_armv7be(self):
:avocado: tags=console:ttyAMA0
:avocado: tags=shutdown:nowait
"""
- self.common_tuxrun()
+ sums = {"rootfs.ext4.zst" :
+ "42ed46dd2d59986206c5b1f6cf35eab58fe3fd20c96b41aaa16b32f3f90a9835",
+ "zImage" :
+ "7facc62082b57af12015b08f7fdbaf2f123ba07a478367853ae12b219afc9f2f" }
+
+ self.common_tuxrun(csums=sums)
def test_i386(self):
"""
@@ -243,7 +284,12 @@ def test_i386(self):
:avocado: tags=image:bzImage
:avocado: tags=shutdown:nowait
"""
- self.common_tuxrun(drive="virtio-blk-pci")
+ sums = {"bzImage" :
+ "a3e5b32a354729e65910f5a1ffcda7c14a6c12a55e8213fb86e277f1b76ed956",
+ "rootfs.ext4.zst" :
+ "f15e66b2bf673a210ec2a4b2e744a80530b36289e04f5388aab812b97f69754a" }
+
+ self.common_tuxrun(csums=sums, drive="virtio-blk-pci")
def test_mips32(self):
"""
@@ -256,7 +302,12 @@ def test_mips32(self):
:avocado: tags=root:sda
:avocado: tags=shutdown:nowait
"""
- self.common_tuxrun(drive="driver=ide-hd,bus=ide.0,unit=0")
+ sums = { "rootfs.ext4.zst" :
+ "fc3da0b4c2f38d74c6d705123bb0f633c76ed953128f9d0859378c328a6d11a0",
+ "vmlinux" :
+ "bfd2172f8b17fb32970ca0c8c58f59c5a4ca38aa5855d920be3a69b5d16e52f0" }
+
+ self.common_tuxrun(csums=sums, drive="driver=ide-hd,bus=ide.0,unit=0")
def test_mips32el(self):
"""
@@ -268,7 +319,12 @@ def test_mips32el(self):
:avocado: tags=root:sda
:avocado: tags=shutdown:nowait
"""
- self.common_tuxrun(drive="driver=ide-hd,bus=ide.0,unit=0")
+ sums = { "rootfs.ext4.zst" :
+ "e799768e289fd69209c21f4dacffa11baea7543d5db101e8ce27e3bc2c41d90e",
+ "vmlinux" :
+ "8573867c68a8443db8de6d08bb33fb291c189ca2ca671471d3973a3e712096a3" }
+
+ self.common_tuxrun(csums=sums, drive="driver=ide-hd,bus=ide.0,unit=0")
def test_mips64(self):
"""
@@ -280,7 +336,12 @@ def test_mips64(self):
:avocado: tags=root:sda
:avocado: tags=shutdown:nowait
"""
- self.common_tuxrun(drive="driver=ide-hd,bus=ide.0,unit=0")
+ sums = { "rootfs.ext4.zst" :
+ "69d91eeb04df3d8d172922c6993bb37d4deeb6496def75d8580f6f9de3e431da",
+ "vmlinux" :
+ "09010e51e4b8bcbbd2494786ffb48eca78f228e96e5c5438344b0eac4029dc61" }
+
+ self.common_tuxrun(csums=sums, drive="driver=ide-hd,bus=ide.0,unit=0")
def test_mips64el(self):
"""
@@ -291,7 +352,12 @@ def test_mips64el(self):
:avocado: tags=root:sda
:avocado: tags=shutdown:nowait
"""
- self.common_tuxrun(drive="driver=ide-hd,bus=ide.0,unit=0")
+ sums = { "rootfs.ext4.zst" :
+ "fba585368f5915b1498ed081863474b2d7ec4e97cdd46d21bdcb2f9698f83de4",
+ "vmlinux" :
+ "d4e08965e2155c4cccce7c5f34d18fe34c636cda2f2c9844387d614950155266" }
+
+ self.common_tuxrun(csums=sums, drive="driver=ide-hd,bus=ide.0,unit=0")
def test_ppc32(self):
"""
@@ -302,7 +368,12 @@ def test_ppc32(self):
:avocado: tags=image:uImage
:avocado: tags=shutdown:nowait
"""
- self.common_tuxrun(drive="virtio-blk-pci")
+ sums = { "rootfs.ext4.zst" :
+ "8885b9d999cc24d679542a02e9b6aaf48f718f2050ece6b8347074b6ee41dd09",
+ "uImage" :
+ "1a68f74b860fda022fb12e03c5efece8c2b8b590d96cca37a8481a3ae0b3f81f" }
+
+ self.common_tuxrun(csums=sums, drive="virtio-blk-pci")
def test_ppc64(self):
"""
@@ -316,7 +387,12 @@ def test_ppc64(self):
:avocado: tags=extradev:driver=spapr-vscsi
:avocado: tags=root:sda
"""
- self.common_tuxrun(drive="scsi-hd")
+ sums = { "rootfs.ext4.zst" :
+ "1d953e81a4379e537fc8e41e05a0a59d9b453eef97aa03d47866c6c45b00bdff",
+ "vmlinux" :
+ "f22a9b9e924174a4c199f4c7e5d91a2339fcfe51c6eafd0907dc3e09b64ab728" }
+
+ self.common_tuxrun(csums=sums, drive="scsi-hd")
def test_ppc64le(self):
"""
@@ -329,7 +405,12 @@ def test_ppc64le(self):
:avocado: tags=extradev:driver=spapr-vscsi
:avocado: tags=root:sda
"""
- self.common_tuxrun(drive="scsi-hd")
+ sums = { "rootfs.ext4.zst" :
+ "b442678c93fb8abe1f7d3bfa20556488de6b475c22c8fed363f42cf81a0a3906",
+ "vmlinux" :
+ "979eb61b445a010fb13e2b927126991f8ceef9c590fa2be0996c00e293e80cf2" }
+
+ self.common_tuxrun(csums=sums, drive="scsi-hd")
def test_riscv32(self):
"""
@@ -337,7 +418,14 @@ def test_riscv32(self):
:avocado: tags=machine:virt
:avocado: tags=tuxboot:riscv32
"""
- self.common_tuxrun()
+ sums = { "Image" :
+ "89599407d7334de629a40e7ad6503c73670359eb5f5ae9d686353a3d6deccbd5",
+ "fw_jump.elf" :
+ "f2ef28a0b77826f79d085d3e4aa686f1159b315eff9099a37046b18936676985",
+ "rootfs.ext4.zst" :
+ "7168d296d0283238ea73cd5a775b3dd608e55e04c7b92b76ecce31bb13108cba" }
+
+ self.common_tuxrun(csums=sums)
def test_riscv64(self):
"""
@@ -345,7 +433,14 @@ def test_riscv64(self):
:avocado: tags=machine:virt
:avocado: tags=tuxboot:riscv64
"""
- self.common_tuxrun()
+ sums = { "Image" :
+ "cd634badc65e52fb63465ec99e309c0de0369f0841b7d9486f9729e119bac25e",
+ "fw_jump.elf" :
+ "6e3373abcab4305fe151b564a4c71110d833c21f2c0a1753b7935459e36aedcf",
+ "rootfs.ext4.zst" :
+ "b18e3a3bdf27be03da0b285e84cb71bf09eca071c3a087b42884b6982ed679eb" }
+
+ self.common_tuxrun(csums=sums)
def test_s390(self):
"""
@@ -355,7 +450,13 @@ def test_s390(self):
:avocado: tags=image:bzImage
:avocado: tags=shutdown:nowait
"""
- self.common_tuxrun(drive="virtio-blk-ccw",
+ sums = { "bzImage" :
+ "0414e98dd1c3dafff8496c9cd9c28a5f8d04553bb5ba37e906a812b48d442ef0",
+ "rootfs.ext4.zst" :
+ "88c37c32276677f873a25ab9ec6247895b8e3e6f8259134de2a616080b8ab3fc" }
+
+ self.common_tuxrun(csums=sums,
+ drive="virtio-blk-ccw",
haltmsg="Requesting system halt")
# Note: some segfaults caused by unaligned userspace access
@@ -370,9 +471,14 @@ def test_sh4(self):
:avocado: tags=root:sda
:avocado: tags=console:ttySC1
"""
+ sums = { "rootfs.ext4.zst" :
+ "3592a7a3d5a641e8b9821449e77bc43c9904a56c30d45da0694349cfd86743fd",
+ "zImage" :
+ "29d9b2aba604a0f53a5dc3b5d0f2b8e35d497de1129f8ee5139eb6fdf0db692f" }
+
# The test is currently too unstable to do much in userspace
# so we skip common_tuxrun and do a minimal boot and shutdown.
- (kernel, disk, dtb) = self.fetch_tuxrun_assets()
+ (kernel, disk, dtb) = self.fetch_tuxrun_assets(csums=sums)
# the console comes on the second serial port
self.prepare_run(kernel, disk,
@@ -395,7 +501,13 @@ def test_sparc64(self):
:avocado: tags=root:sda
:avocado: tags=shutdown:nowait
"""
- self.common_tuxrun(drive="driver=ide-hd,bus=ide.0,unit=0")
+
+ sums = { "rootfs.ext4.zst" :
+ "ad2f1dc436ab51583543d25d2c210cab478645d47078d30d129a66ab0e281d76",
+ "vmlinux" :
+ "e34313e4325ff21deaa3d38a502aa09a373ef62b9bd4d7f8f29388b688225c55" }
+
+ self.common_tuxrun(csums=sums, drive="driver=ide-hd,bus=ide.0,unit=0")
def test_x86_64(self):
"""
@@ -407,4 +519,10 @@ def test_x86_64(self):
:avocado: tags=root:sda
:avocado: tags=shutdown:nowait
"""
- self.common_tuxrun(drive="driver=ide-hd,bus=ide.0,unit=0")
+ sums = { "bzImage" :
+ "2bc7480a669ee9b6b82500a236aba0c54233debe98cb968268fa230f52f03461",
+ "rootfs.ext4.zst" :
+ "b72ac729769b8f51c6dffb221113c9a063c774dbe1d66af30eb593c4e9999b4b" }
+
+ self.common_tuxrun(csums=sums,
+ drive="driver=ide-hd,bus=ide.0,unit=0")
--
2.39.2
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PULL 02/18] tests/avocado: use the new snapshots for testing
2023-04-27 15:44 ` [PULL 02/18] tests/avocado: use the new snapshots for testing Alex Bennée
@ 2023-04-28 12:08 ` Thomas Huth
2023-04-28 16:43 ` Alex Bennée
0 siblings, 1 reply; 26+ messages in thread
From: Thomas Huth @ 2023-04-28 12:08 UTC (permalink / raw)
To: Alex Bennée, qemu-devel, qemu-ppc@nongnu.org
Cc: richard.henderson, Philippe Mathieu-Daudé,
Wainer dos Santos Moschetta, Beraldo Leal, Cleber Rosa,
Daniel Henrique Barboza, Cédric Le Goater
On 27/04/2023 17.44, Alex Bennée wrote:
> The tuxboot images now have a stable snapshot URL so we can enable the
> checksums and remove the avocado warnings. We will have to update as
> old snapshots retire but that won't be too frequent.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Acked-by: Thomas Huth <thuth@redhat.com>
> Message-Id: <20230424092249.58552-3-alex.bennee@linaro.org>
...
> @@ -316,7 +387,12 @@ def test_ppc64(self):
> :avocado: tags=extradev:driver=spapr-vscsi
> :avocado: tags=root:sda
> """
> - self.common_tuxrun(drive="scsi-hd")
> + sums = { "rootfs.ext4.zst" :
> + "1d953e81a4379e537fc8e41e05a0a59d9b453eef97aa03d47866c6c45b00bdff",
> + "vmlinux" :
> + "f22a9b9e924174a4c199f4c7e5d91a2339fcfe51c6eafd0907dc3e09b64ab728" }
> +
> + self.common_tuxrun(csums=sums, drive="scsi-hd")
>
> def test_ppc64le(self):
> """
> @@ -329,7 +405,12 @@ def test_ppc64le(self):
> :avocado: tags=extradev:driver=spapr-vscsi
> :avocado: tags=root:sda
> """
> - self.common_tuxrun(drive="scsi-hd")
> + sums = { "rootfs.ext4.zst" :
> + "b442678c93fb8abe1f7d3bfa20556488de6b475c22c8fed363f42cf81a0a3906",
> + "vmlinux" :
> + "979eb61b445a010fb13e2b927126991f8ceef9c590fa2be0996c00e293e80cf2" }
> +
> + self.common_tuxrun(csums=sums, drive="scsi-hd")
Hi Alex,
when I run the manual avocado-cfi-ppc64-s390x test on gitlab, the ppc64 and
ppc64le tuxrun tests are now failing for me:
https://gitlab.com/thuth/qemu/-/jobs/4196177779#L758
Are they working for you?
Thomas
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PULL 02/18] tests/avocado: use the new snapshots for testing
2023-04-28 12:08 ` Thomas Huth
@ 2023-04-28 16:43 ` Alex Bennée
0 siblings, 0 replies; 26+ messages in thread
From: Alex Bennée @ 2023-04-28 16:43 UTC (permalink / raw)
To: Thomas Huth
Cc: qemu-devel, qemu-ppc@nongnu.org, richard.henderson,
Philippe Mathieu-Daudé, Wainer dos Santos Moschetta,
Beraldo Leal, Cleber Rosa, Daniel Henrique Barboza,
Cédric Le Goater
Thomas Huth <thuth@redhat.com> writes:
> On 27/04/2023 17.44, Alex Bennée wrote:
>> The tuxboot images now have a stable snapshot URL so we can enable the
>> checksums and remove the avocado warnings. We will have to update as
>> old snapshots retire but that won't be too frequent.
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> Acked-by: Thomas Huth <thuth@redhat.com>
>> Message-Id: <20230424092249.58552-3-alex.bennee@linaro.org>
> ...
>> @@ -316,7 +387,12 @@ def test_ppc64(self):
>> :avocado: tags=extradev:driver=spapr-vscsi
>> :avocado: tags=root:sda
>> """
>> - self.common_tuxrun(drive="scsi-hd")
>> + sums = { "rootfs.ext4.zst" :
>> + "1d953e81a4379e537fc8e41e05a0a59d9b453eef97aa03d47866c6c45b00bdff",
>> + "vmlinux" :
>> + "f22a9b9e924174a4c199f4c7e5d91a2339fcfe51c6eafd0907dc3e09b64ab728" }
>> +
>> + self.common_tuxrun(csums=sums, drive="scsi-hd")
>> def test_ppc64le(self):
>> """
>> @@ -329,7 +405,12 @@ def test_ppc64le(self):
>> :avocado: tags=extradev:driver=spapr-vscsi
>> :avocado: tags=root:sda
>> """
>> - self.common_tuxrun(drive="scsi-hd")
>> + sums = { "rootfs.ext4.zst" :
>> + "b442678c93fb8abe1f7d3bfa20556488de6b475c22c8fed363f42cf81a0a3906",
>> + "vmlinux" :
>> + "979eb61b445a010fb13e2b927126991f8ceef9c590fa2be0996c00e293e80cf2" }
>> +
>> + self.common_tuxrun(csums=sums, drive="scsi-hd")
>
> Hi Alex,
>
> when I run the manual avocado-cfi-ppc64-s390x test on gitlab, the
> ppc64 and ppc64le tuxrun tests are now failing for me:
>
> https://gitlab.com/thuth/qemu/-/jobs/4196177779#L758
>
> Are they working for you?
Locally yes. I guess its time to spin up some VMs
>
> Thomas
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PULL 03/18] tests/avocado: Add set of boot tests on SBSA-ref
2023-04-27 15:44 [PULL 00/18] testing and doc updates Alex Bennée
2023-04-27 15:44 ` [PULL 01/18] tests/requirements.txt: bump up avocado-framework version to 101.0 Alex Bennée
2023-04-27 15:44 ` [PULL 02/18] tests/avocado: use the new snapshots for testing Alex Bennée
@ 2023-04-27 15:44 ` Alex Bennée
2023-04-28 10:33 ` Thomas Huth
2023-04-27 15:44 ` [PULL 04/18] gitlab-ci: Avoid to re-run "configure" in the device-crash-test jobs Alex Bennée
` (16 subsequent siblings)
19 siblings, 1 reply; 26+ messages in thread
From: Alex Bennée @ 2023-04-27 15:44 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, Philippe Mathieu-Daudé,
Marcin Juszkiewicz, Leif Lindholm, Alex Bennée,
Radoslaw Biernacki, Peter Maydell, Cleber Rosa,
Wainer dos Santos Moschetta, Beraldo Leal, open list:SBSA-REF
From: Philippe Mathieu-Daudé <philmd@linaro.org>
This change adds set of boot tests on SBSA-ref machine:
1. boot firmware up to the EDK2 banner
2. boot Alpine Linux
Prebuilt flash volumes are included, built using upstream documentation.
To unify tests for AArch64/virt and AArch64/sbsa-ref we boot
the same Alpine Linux image on both.
Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230323082813.971535-1-marcin.juszkiewicz@linaro.org>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Message-Id: <20230328171426.14258-1-philmd@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230424092249.58552-4-alex.bennee@linaro.org>
diff --git a/MAINTAINERS b/MAINTAINERS
index a8b942dea4..214124c84c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -943,6 +943,7 @@ L: qemu-arm@nongnu.org
S: Maintained
F: hw/arm/sbsa-ref.c
F: docs/system/arm/sbsa.rst
+F: tests/avocado/machine_aarch64_sbsaref.py
Sharp SL-5500 (Collie) PDA
M: Peter Maydell <peter.maydell@linaro.org>
diff --git a/tests/avocado/machine_aarch64_sbsaref.py b/tests/avocado/machine_aarch64_sbsaref.py
new file mode 100644
index 0000000000..0a79fa7ab6
--- /dev/null
+++ b/tests/avocado/machine_aarch64_sbsaref.py
@@ -0,0 +1,158 @@
+# Functional test that boots a Linux kernel and checks the console
+#
+# SPDX-FileCopyrightText: 2023 Linaro Ltd.
+# SPDX-FileContributor: Philippe Mathieu-Daudé <philmd@linaro.org>
+# SPDX-FileContributor: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+import os
+
+from avocado import skip
+from avocado import skipUnless
+from avocado.utils import archive
+
+from avocado_qemu import QemuSystemTest
+from avocado_qemu import wait_for_console_pattern
+from avocado_qemu import interrupt_interactive_console_until_pattern
+
+
+class Aarch64SbsarefMachine(QemuSystemTest):
+ """
+ :avocado: tags=arch:aarch64
+ :avocado: tags=machine:sbsa-ref
+ """
+
+ timeout = 180
+
+ def fetch_firmware(self):
+ """
+ Flash volumes generated using:
+
+ - Fedora GNU Toolchain version 12.2.1 20220819 (Red Hat Cross 12.2.1-2)
+
+ - Trusted Firmware-A
+ https://github.com/ARM-software/arm-trusted-firmware/tree/5fdb2e54
+
+ - Tianocore EDK II
+ https://github.com/tianocore/edk2/tree/494127613b
+ https://github.com/tianocore/edk2-non-osi/tree/41876073
+ https://github.com/tianocore/edk2-platforms/tree/8efa4f42
+ """
+
+ # Secure BootRom (TF-A code)
+ fs0_xz_url = (
+ "https://fileserver.linaro.org/s/ATnSmq6k8SoXgbH/"
+ "download/SBSA_FLASH0.fd.xz"
+ )
+ fs0_xz_hash = "a210a09692bcbe0a3743ffd0df44e80e0c7ad8ab"
+ tar_xz_path = self.fetch_asset(fs0_xz_url, asset_hash=fs0_xz_hash)
+ archive.extract(tar_xz_path, self.workdir)
+ fs0_path = os.path.join(self.workdir, "SBSA_FLASH0.fd")
+
+ # Non-secure rom (UEFI and EFI variables)
+ fs1_xz_url = (
+ "https://fileserver.linaro.org/s/t8foNnMPz74DZZy/"
+ "download/SBSA_FLASH1.fd.xz"
+ )
+ fs1_xz_hash = "13a9a262953787c7fc5a9155dfaa26e703631e02"
+ tar_xz_path = self.fetch_asset(fs1_xz_url, asset_hash=fs1_xz_hash)
+ archive.extract(tar_xz_path, self.workdir)
+ fs1_path = os.path.join(self.workdir, "SBSA_FLASH1.fd")
+
+ for path in [fs0_path, fs1_path]:
+ with open(path, "ab+") as fd:
+ fd.truncate(256 << 20) # Expand volumes to 256MiB
+
+ self.vm.set_console()
+ self.vm.add_args(
+ "-drive",
+ f"if=pflash,file={fs0_path},format=raw",
+ "-drive",
+ f"if=pflash,file={fs1_path},format=raw",
+ "-smp",
+ "1",
+ "-machine",
+ "sbsa-ref",
+ )
+
+ def test_sbsaref_edk2_firmware(self):
+ """
+ :avocado: tags=cpu:cortex-a57
+ """
+
+ self.fetch_firmware()
+ self.vm.launch()
+
+ # TF-A boot sequence:
+ #
+ # https://github.com/ARM-software/arm-trusted-firmware/blob/v2.8.0/\
+ # docs/design/trusted-board-boot.rst#trusted-board-boot-sequence
+ # https://trustedfirmware-a.readthedocs.io/en/v2.8/\
+ # design/firmware-design.html#cold-boot
+
+ # AP Trusted ROM
+ wait_for_console_pattern(self, "Booting Trusted Firmware")
+ wait_for_console_pattern(self, "BL1: v2.8(release):v2.8")
+ wait_for_console_pattern(self, "BL1: Booting BL2")
+
+ # Trusted Boot Firmware
+ wait_for_console_pattern(self, "BL2: v2.8(release)")
+ wait_for_console_pattern(self, "Booting BL31")
+
+ # EL3 Runtime Software
+ wait_for_console_pattern(self, "BL31: v2.8(release)")
+
+ # Non-trusted Firmware
+ wait_for_console_pattern(self, "UEFI firmware (version 1.0")
+ interrupt_interactive_console_until_pattern(self, "QEMU SBSA-REF Machine")
+
+ # This tests the whole boot chain from EFI to Userspace
+ # We only boot a whole OS for the current top level CPU and GIC
+ # Other test profiles should use more minimal boots
+ def boot_alpine_linux(self, cpu):
+ self.fetch_firmware()
+
+ iso_url = (
+ "https://dl-cdn.alpinelinux.org/"
+ "alpine/v3.17/releases/aarch64/alpine-standard-3.17.2-aarch64.iso"
+ )
+
+ iso_hash = "5a36304ecf039292082d92b48152a9ec21009d3a62f459de623e19c4bd9dc027"
+ iso_path = self.fetch_asset(iso_url, algorithm="sha256", asset_hash=iso_hash)
+
+ self.vm.set_console()
+ self.vm.add_args(
+ "-cpu",
+ cpu,
+ "-drive",
+ f"file={iso_path},format=raw",
+ "-device",
+ "virtio-rng-pci,rng=rng0",
+ "-object",
+ "rng-random,id=rng0,filename=/dev/urandom",
+ )
+
+ self.vm.launch()
+ wait_for_console_pattern(self, "Welcome to Alpine Linux 3.17")
+
+ @skipUnless(os.getenv("AVOCADO_TIMEOUT_EXPECTED"), "Test might timeout")
+ def test_sbsaref_alpine_linux_cortex_a57(self):
+ """
+ :avocado: tags=cpu:cortex-a57
+ """
+ self.boot_alpine_linux("cortex-a57")
+
+ @skipUnless(os.getenv("AVOCADO_TIMEOUT_EXPECTED"), "Test might timeout")
+ def test_sbsaref_alpine_linux_neoverse_n1(self):
+ """
+ :avocado: tags=cpu:max
+ """
+ self.boot_alpine_linux("neoverse-n1")
+
+ @skip("requires TF-A update to handle FEAT_FGT")
+ def test_sbsaref_alpine_linux_max(self):
+ """
+ :avocado: tags=cpu:max
+ """
+ self.boot_alpine_linux("max,pauth-impdef=on")
--
2.39.2
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PULL 03/18] tests/avocado: Add set of boot tests on SBSA-ref
2023-04-27 15:44 ` [PULL 03/18] tests/avocado: Add set of boot tests on SBSA-ref Alex Bennée
@ 2023-04-28 10:33 ` Thomas Huth
2023-07-10 12:10 ` Thomas Huth
0 siblings, 1 reply; 26+ messages in thread
From: Thomas Huth @ 2023-04-28 10:33 UTC (permalink / raw)
To: Alex Bennée, qemu-devel, Marcin Juszkiewicz,
Philippe Mathieu-Daudé
Cc: richard.henderson, Leif Lindholm, Radoslaw Biernacki,
Peter Maydell, Cleber Rosa, Wainer dos Santos Moschetta,
Beraldo Leal, open list:SBSA-REF
On 27/04/2023 17.44, Alex Bennée wrote:
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
>
> This change adds set of boot tests on SBSA-ref machine:
>
> 1. boot firmware up to the EDK2 banner
> 2. boot Alpine Linux
>
> Prebuilt flash volumes are included, built using upstream documentation.
>
> To unify tests for AArch64/virt and AArch64/sbsa-ref we boot
> the same Alpine Linux image on both.
>
> Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Message-Id: <20230323082813.971535-1-marcin.juszkiewicz@linaro.org>
> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
> Message-Id: <20230328171426.14258-1-philmd@linaro.org>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Message-Id: <20230424092249.58552-4-alex.bennee@linaro.org>
...
> + def test_sbsaref_edk2_firmware(self):
> + """
> + :avocado: tags=cpu:cortex-a57
> + """
This is failing for me in the gitlab-CI:
https://gitlab.com/thuth/qemu/-/jobs/4196177756#L489
Could you please have a look?
Thanks,
Thomas
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PULL 03/18] tests/avocado: Add set of boot tests on SBSA-ref
2023-04-28 10:33 ` Thomas Huth
@ 2023-07-10 12:10 ` Thomas Huth
0 siblings, 0 replies; 26+ messages in thread
From: Thomas Huth @ 2023-07-10 12:10 UTC (permalink / raw)
To: Alex Bennée, qemu-devel, Marcin Juszkiewicz,
Philippe Mathieu-Daudé
Cc: richard.henderson, Leif Lindholm, Radoslaw Biernacki,
Peter Maydell, Cleber Rosa, Wainer dos Santos Moschetta,
Beraldo Leal, open list:SBSA-REF
On 28/04/2023 12.33, Thomas Huth wrote:
> On 27/04/2023 17.44, Alex Bennée wrote:
>> From: Philippe Mathieu-Daudé <philmd@linaro.org>
>>
>> This change adds set of boot tests on SBSA-ref machine:
>>
>> 1. boot firmware up to the EDK2 banner
>> 2. boot Alpine Linux
>>
>> Prebuilt flash volumes are included, built using upstream documentation.
>>
>> To unify tests for AArch64/virt and AArch64/sbsa-ref we boot
>> the same Alpine Linux image on both.
>>
>> Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> Message-Id: <20230323082813.971535-1-marcin.juszkiewicz@linaro.org>
>> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
>> Message-Id: <20230328171426.14258-1-philmd@linaro.org>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> Message-Id: <20230424092249.58552-4-alex.bennee@linaro.org>
> ...
>> + def test_sbsaref_edk2_firmware(self):
>> + """
>> + :avocado: tags=cpu:cortex-a57
>> + """
>
> This is failing for me in the gitlab-CI:
>
> https://gitlab.com/thuth/qemu/-/jobs/4196177756#L489
>
> Could you please have a look?
This test is still failing for me occasionally:
https://gitlab.com/thuth/qemu/-/jobs/4623296271#L290
If nobody has a clue how to make it more stable, I'd suggest that we disable
it in the gitlab-CI ?
Thomas
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PULL 04/18] gitlab-ci: Avoid to re-run "configure" in the device-crash-test jobs
2023-04-27 15:44 [PULL 00/18] testing and doc updates Alex Bennée
` (2 preceding siblings ...)
2023-04-27 15:44 ` [PULL 03/18] tests/avocado: Add set of boot tests on SBSA-ref Alex Bennée
@ 2023-04-27 15:44 ` Alex Bennée
2023-04-27 15:44 ` [PULL 05/18] scripts/device-crash-test: Add a parameter to run with TCG only Alex Bennée
` (15 subsequent siblings)
19 siblings, 0 replies; 26+ messages in thread
From: Alex Bennée @ 2023-04-27 15:44 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, Thomas Huth, Alex Bennée,
Philippe Mathieu-Daudé, Wainer dos Santos Moschetta,
Beraldo Leal
From: Thomas Huth <thuth@redhat.com>
After "make check-venv" had been added to these jobs, they started
to re-run "configure" each time since our logic in the makefile
thinks that some files are out of date here. Avoid it with the same
trick that we are using in buildtest-template.yml already by disabling
the up-to-date check via NINJA=":".
Fixes: 1d8cf47e5b ("tests: run 'device-crash-test' from tests/venv")
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20230414145845.456145-2-thuth@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230424092249.58552-5-alex.bennee@linaro.org>
diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
index ba6f551752..333eea9dd3 100644
--- a/.gitlab-ci.d/buildtest.yml
+++ b/.gitlab-ci.d/buildtest.yml
@@ -102,7 +102,7 @@ crash-test-debian:
IMAGE: debian-amd64
script:
- cd build
- - make check-venv
+ - make NINJA=":" check-venv
- tests/venv/bin/python3 scripts/device-crash-test -q ./qemu-system-i386
build-system-fedora:
@@ -145,7 +145,7 @@ crash-test-fedora:
IMAGE: fedora
script:
- cd build
- - make check-venv
+ - make NINJA=":" check-venv
- tests/venv/bin/python3 scripts/device-crash-test -q ./qemu-system-ppc
- tests/venv/bin/python3 scripts/device-crash-test -q ./qemu-system-riscv32
--
2.39.2
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PULL 05/18] scripts/device-crash-test: Add a parameter to run with TCG only
2023-04-27 15:44 [PULL 00/18] testing and doc updates Alex Bennée
` (3 preceding siblings ...)
2023-04-27 15:44 ` [PULL 04/18] gitlab-ci: Avoid to re-run "configure" in the device-crash-test jobs Alex Bennée
@ 2023-04-27 15:44 ` Alex Bennée
2023-04-27 15:44 ` [PULL 06/18] qemu-options: finesse the recommendations around -blockdev Alex Bennée
` (14 subsequent siblings)
19 siblings, 0 replies; 26+ messages in thread
From: Alex Bennée @ 2023-04-27 15:44 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, Thomas Huth, Eldon Stegall,
Philippe Mathieu-Daudé, Alex Bennée,
Wainer dos Santos Moschetta, Beraldo Leal
From: Thomas Huth <thuth@redhat.com>
We're currently facing the problem that the device-crash-test script
runs twice as long in the CI when a runner supports KVM - which sometimes
results in a timeout of the CI job. To get a more deterministic runtime
here, add an option to the script that allows to run it with TCG only.
Reported-by: Eldon Stegall <eldon-qemu@eldondev.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230414145845.456145-3-thuth@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230424092249.58552-6-alex.bennee@linaro.org>
diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
index 333eea9dd3..bb3650a51c 100644
--- a/.gitlab-ci.d/buildtest.yml
+++ b/.gitlab-ci.d/buildtest.yml
@@ -103,7 +103,7 @@ crash-test-debian:
script:
- cd build
- make NINJA=":" check-venv
- - tests/venv/bin/python3 scripts/device-crash-test -q ./qemu-system-i386
+ - tests/venv/bin/python3 scripts/device-crash-test -q --tcg-only ./qemu-system-i386
build-system-fedora:
extends:
diff --git a/scripts/device-crash-test b/scripts/device-crash-test
index 73bcb98693..b74d887331 100755
--- a/scripts/device-crash-test
+++ b/scripts/device-crash-test
@@ -397,7 +397,7 @@ def binariesToTest(args, testcase):
def accelsToTest(args, testcase):
- if getBinaryInfo(args, testcase['binary']).kvm_available:
+ if getBinaryInfo(args, testcase['binary']).kvm_available and not args.tcg_only:
yield 'kvm'
yield 'tcg'
@@ -510,6 +510,8 @@ def main():
help="Full mode: test cases that are expected to fail")
parser.add_argument('--strict', action='store_true', dest='strict',
help="Treat all warnings as fatal")
+ parser.add_argument('--tcg-only', action='store_true', dest='tcg_only',
+ help="Only test with TCG accelerator")
parser.add_argument('qemu', nargs='*', metavar='QEMU',
help='QEMU binary to run')
args = parser.parse_args()
--
2.39.2
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PULL 06/18] qemu-options: finesse the recommendations around -blockdev
2023-04-27 15:44 [PULL 00/18] testing and doc updates Alex Bennée
` (4 preceding siblings ...)
2023-04-27 15:44 ` [PULL 05/18] scripts/device-crash-test: Add a parameter to run with TCG only Alex Bennée
@ 2023-04-27 15:44 ` Alex Bennée
2023-04-27 15:44 ` [PULL 07/18] .gitlab-ci.d/cirrus: Drop the CI job for compiling with FreeBSD 12 Alex Bennée
` (13 subsequent siblings)
19 siblings, 0 replies; 26+ messages in thread
From: Alex Bennée @ 2023-04-27 15:44 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, Alex Bennée, Michael Tokarev, Thomas Huth,
Markus Armbruster, Kevin Wolf
We are a bit premature in recommending -blockdev/-device as the best
way to configure block devices. It seems there are times the more
human friendly -drive still makes sense especially when -snapshot is
involved.
Improve the language to hopefully make things clearer.
Suggested-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20230424092249.58552-7-alex.bennee@linaro.org>
diff --git a/qemu-options.hx b/qemu-options.hx
index 04c259157a..baa0589733 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1143,10 +1143,22 @@ have gone through several iterations as the feature set and complexity
of the block layer have grown. Many online guides to QEMU often
reference older and deprecated options, which can lead to confusion.
-The recommended modern way to describe disks is to use a combination of
+The most explicit way to describe disks is to use a combination of
``-device`` to specify the hardware device and ``-blockdev`` to
describe the backend. The device defines what the guest sees and the
-backend describes how QEMU handles the data.
+backend describes how QEMU handles the data. It is the only guaranteed
+stable interface for describing block devices and as such is
+recommended for management tools and scripting.
+
+The ``-drive`` option combines the device and backend into a single
+command line option which is a more human friendly. There is however no
+interface stability guarantee although some older board models still
+need updating to work with the modern blockdev forms.
+
+Older options like ``-hda`` are essentially macros which expand into
+``-drive`` options for various drive interfaces. The original forms
+bake in a lot of assumptions from the days when QEMU was emulating a
+legacy PC, they are not recommended for modern configurations.
ERST
@@ -1639,6 +1651,14 @@ SRST
the raw disk image you use is not written back. You can however
force the write back by pressing C-a s (see the :ref:`disk images`
chapter in the System Emulation Users Guide).
+
+ .. warning::
+ snapshot is incompatible with ``-blockdev`` (instead use qemu-img
+ to manually create snapshot images to attach to your blockdev).
+ If you have mixed ``-blockdev`` and ``-drive`` declarations you
+ can use the 'snapshot' property on your drive declarations
+ instead of this global option.
+
ERST
DEF("fsdev", HAS_ARG, QEMU_OPTION_fsdev,
--
2.39.2
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PULL 07/18] .gitlab-ci.d/cirrus: Drop the CI job for compiling with FreeBSD 12
2023-04-27 15:44 [PULL 00/18] testing and doc updates Alex Bennée
` (5 preceding siblings ...)
2023-04-27 15:44 ` [PULL 06/18] qemu-options: finesse the recommendations around -blockdev Alex Bennée
@ 2023-04-27 15:44 ` Alex Bennée
2023-04-27 15:45 ` [PULL 08/18] tests/avocado: Make ssh_command_output_contains() globally available Alex Bennée
` (12 subsequent siblings)
19 siblings, 0 replies; 26+ messages in thread
From: Alex Bennée @ 2023-04-27 15:44 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, Thomas Huth, Alex Bennée, Warner Losh,
Philippe Mathieu-Daudé, Wainer dos Santos Moschetta,
Beraldo Leal
From: Thomas Huth <thuth@redhat.com>
FreeBSD 13.0 has been released in April 2021:
https://www.freebsd.org/releases/13.0R/announce/
According to QEMU's support policy, we stop supporting the previous
major release two years after the the new major release has been
published. So we can stop testing FreeBSD 12 in our CI now.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20230418160225.529172-1-thuth@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Warner Losh <imp@bsdimp.com>
Message-Id: <20230424092249.58552-8-alex.bennee@linaro.org>
diff --git a/.gitlab-ci.d/cirrus.yml b/.gitlab-ci.d/cirrus.yml
index 502dfd612c..1507c928e5 100644
--- a/.gitlab-ci.d/cirrus.yml
+++ b/.gitlab-ci.d/cirrus.yml
@@ -44,19 +44,6 @@
variables:
QEMU_JOB_CIRRUS: 1
-x64-freebsd-12-build:
- extends: .cirrus_build_job
- variables:
- NAME: freebsd-12
- CIRRUS_VM_INSTANCE_TYPE: freebsd_instance
- CIRRUS_VM_IMAGE_SELECTOR: image_family
- CIRRUS_VM_IMAGE_NAME: freebsd-12-4
- CIRRUS_VM_CPUS: 8
- CIRRUS_VM_RAM: 8G
- UPDATE_COMMAND: pkg update; pkg upgrade -y
- INSTALL_COMMAND: pkg install -y
- TEST_TARGETS: check
-
x64-freebsd-13-build:
extends: .cirrus_build_job
variables:
diff --git a/.gitlab-ci.d/cirrus/freebsd-12.vars b/.gitlab-ci.d/cirrus/freebsd-12.vars
deleted file mode 100644
index 44d8a2a511..0000000000
--- a/.gitlab-ci.d/cirrus/freebsd-12.vars
+++ /dev/null
@@ -1,16 +0,0 @@
-# THIS FILE WAS AUTO-GENERATED
-#
-# $ lcitool variables freebsd-12 qemu
-#
-# https://gitlab.com/libvirt/libvirt-ci
-
-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 cdrkit-genisoimage 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 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 zstd'
-PYPI_PKGS=''
-PYTHON='/usr/local/bin/python3'
diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh
index 33ef1282da..f1570b54df 100755
--- a/tests/lcitool/refresh
+++ b/tests/lcitool/refresh
@@ -182,7 +182,6 @@ try:
#
# Cirrus packages lists for GitLab
#
- generate_cirrus("freebsd-12")
generate_cirrus("freebsd-13")
generate_cirrus("macos-12")
--
2.39.2
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PULL 08/18] tests/avocado: Make ssh_command_output_contains() globally available
2023-04-27 15:44 [PULL 00/18] testing and doc updates Alex Bennée
` (6 preceding siblings ...)
2023-04-27 15:44 ` [PULL 07/18] .gitlab-ci.d/cirrus: Drop the CI job for compiling with FreeBSD 12 Alex Bennée
@ 2023-04-27 15:45 ` Alex Bennée
2023-04-27 15:45 ` [PULL 09/18] tests/avocado/machine_aspeed: Fix the broken ast2[56]00_evb_sdk tests Alex Bennée
` (11 subsequent siblings)
19 siblings, 0 replies; 26+ messages in thread
From: Alex Bennée @ 2023-04-27 15:45 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, Thomas Huth, Cédric Le Goater,
Alex Bennée, Cleber Rosa, Philippe Mathieu-Daudé,
Wainer dos Santos Moschetta, Beraldo Leal, Aurelien Jarno
From: Thomas Huth <thuth@redhat.com>
This function will be useful in other tests, too, so move it to the
core LinuxSSHMixIn class.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20230421110345.1294131-2-thuth@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230424092249.58552-9-alex.bennee@linaro.org>
diff --git a/tests/avocado/avocado_qemu/__init__.py b/tests/avocado/avocado_qemu/__init__.py
index cb71f50db9..6788837e1b 100644
--- a/tests/avocado/avocado_qemu/__init__.py
+++ b/tests/avocado/avocado_qemu/__init__.py
@@ -431,6 +431,14 @@ def ssh_command(self, command):
f'Guest command failed: {command}')
return stdout_lines, stderr_lines
+ def ssh_command_output_contains(self, cmd, exp):
+ stdout, _ = self.ssh_command(cmd)
+ for line in stdout:
+ if exp in line:
+ break
+ else:
+ self.fail('"%s" output does not contain "%s"' % (cmd, exp))
+
class LinuxDistro:
"""Represents a Linux distribution
diff --git a/tests/avocado/linux_ssh_mips_malta.py b/tests/avocado/linux_ssh_mips_malta.py
index 0179d8a6ca..d9bb525ad9 100644
--- a/tests/avocado/linux_ssh_mips_malta.py
+++ b/tests/avocado/linux_ssh_mips_malta.py
@@ -101,14 +101,6 @@ def shutdown_via_ssh(self):
self.ssh_disconnect_vm()
wait_for_console_pattern(self, 'Power down', 'Oops')
- def ssh_command_output_contains(self, cmd, exp):
- stdout, _ = self.ssh_command(cmd)
- for line in stdout:
- if exp in line:
- break
- else:
- self.fail('"%s" output does not contain "%s"' % (cmd, exp))
-
def run_common_commands(self, wordsize):
self.ssh_command_output_contains(
'cat /proc/cpuinfo',
--
2.39.2
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PULL 09/18] tests/avocado/machine_aspeed: Fix the broken ast2[56]00_evb_sdk tests
2023-04-27 15:44 [PULL 00/18] testing and doc updates Alex Bennée
` (7 preceding siblings ...)
2023-04-27 15:45 ` [PULL 08/18] tests/avocado: Make ssh_command_output_contains() globally available Alex Bennée
@ 2023-04-27 15:45 ` Alex Bennée
2023-04-27 15:45 ` [PULL 10/18] MAINTAINERS: Cover tests/avocado/machine_aspeed.py Alex Bennée
` (10 subsequent siblings)
19 siblings, 0 replies; 26+ messages in thread
From: Alex Bennée @ 2023-04-27 15:45 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, Thomas Huth, Cédric Le Goater,
Alex Bennée, Peter Maydell, Andrew Jeffery, Joel Stanley,
Cleber Rosa, Philippe Mathieu-Daudé,
Wainer dos Santos Moschetta, Beraldo Leal, open list:ASPEED BMCs
From: Thomas Huth <thuth@redhat.com>
test_arm_ast2500_evb_sdk and test_arm_ast2600_evb_sdk are currently
failing. The problem is that they are trying to look for the login
prompt that does not have a newline at the end - but the logic in
_console_interaction() only handles full lines. It used to work by
accident in the past since there were sometimes kernel (warning and
error) messages popping up that finally provided a newline character
in the output, but since the tests have been changed to run with the
"quiet" kernel parameter, this is not working anymore.
To make this work reliably, we must not look for the "login:" prompt,
but have to use some text ending with a newline instead. And in the
ast2600 test, switch to ssh instead of trying to log into the serial
console - this works much more reliable and also has the benefit of
excercising the network interface here a little bit, too.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20230421110345.1294131-3-thuth@redhat.com>
[AJB: remove stray debug log]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230424092249.58552-10-alex.bennee@linaro.org>
diff --git a/tests/avocado/machine_aspeed.py b/tests/avocado/machine_aspeed.py
index 2b532c4834..724ee72c02 100644
--- a/tests/avocado/machine_aspeed.py
+++ b/tests/avocado/machine_aspeed.py
@@ -10,6 +10,7 @@
import tempfile
import subprocess
+from avocado_qemu import LinuxSSHMixIn
from avocado_qemu import QemuSystemTest
from avocado_qemu import wait_for_console_pattern
from avocado_qemu import exec_command
@@ -268,7 +269,7 @@ def test_arm_ast2600_evb_buildroot_tpm(self):
self.do_test_arm_aspeed_buildroot_poweroff()
-class AST2x00MachineSDK(QemuSystemTest):
+class AST2x00MachineSDK(QemuSystemTest, LinuxSSHMixIn):
EXTRA_BOOTARGS = (
'quiet '
@@ -295,7 +296,7 @@ def do_test_arm_aspeed_sdk_start(self, image):
self.require_netdev('user')
self.vm.set_console()
self.vm.add_args('-drive', 'file=' + image + ',if=mtd,format=raw',
- '-net', 'nic', '-net', 'user')
+ '-net', 'nic', '-net', 'user,hostfwd=:127.0.0.1:0-:22')
self.vm.launch()
self.wait_for_console_pattern('U-Boot 2019.04')
@@ -323,7 +324,7 @@ def test_arm_ast2500_evb_sdk(self):
self.do_test_arm_aspeed_sdk_start(
self.workdir + '/ast2500-default/image-bmc')
- self.wait_for_console_pattern('ast2500-default login:')
+ self.wait_for_console_pattern('nodistro.0 ast2500-default ttyS4')
@skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
def test_arm_ast2600_evb_sdk(self):
@@ -345,22 +346,25 @@ def test_arm_ast2600_evb_sdk(self):
'ds1338,bus=aspeed.i2c.bus.5,address=0x32');
self.do_test_arm_aspeed_sdk_start(
self.workdir + '/ast2600-default/image-bmc')
- self.wait_for_console_pattern('ast2600-default login:')
- exec_command_and_wait_for_pattern(self, 'root', 'Password:')
- exec_command_and_wait_for_pattern(self, '0penBmc', 'root@ast2600-default:~#')
+ self.wait_for_console_pattern('nodistro.0 ast2600-default ttyS4')
- exec_command_and_wait_for_pattern(self,
- 'echo lm75 0x4d > /sys/class/i2c-dev/i2c-5/device/new_device',
+ self.ssh_connect('root', '0penBmc', False)
+ self.ssh_command('dmesg -c > /dev/null')
+
+ self.ssh_command_output_contains(
+ 'echo lm75 0x4d > /sys/class/i2c-dev/i2c-5/device/new_device ; '
+ 'dmesg -c',
'i2c i2c-5: new_device: Instantiated device lm75 at 0x4d');
- exec_command_and_wait_for_pattern(self,
+ self.ssh_command_output_contains(
'cat /sys/class/hwmon/hwmon19/temp1_input', '0')
self.vm.command('qom-set', path='/machine/peripheral/tmp-test',
property='temperature', value=18000);
- exec_command_and_wait_for_pattern(self,
+ self.ssh_command_output_contains(
'cat /sys/class/hwmon/hwmon19/temp1_input', '18000')
- exec_command_and_wait_for_pattern(self,
- 'echo ds1307 0x32 > /sys/class/i2c-dev/i2c-5/device/new_device',
+ self.ssh_command_output_contains(
+ 'echo ds1307 0x32 > /sys/class/i2c-dev/i2c-5/device/new_device ; '
+ 'dmesg -c',
'i2c i2c-5: new_device: Instantiated device ds1307 at 0x32');
year = time.strftime("%Y")
- exec_command_and_wait_for_pattern(self, 'hwclock -f /dev/rtc1', year);
+ self.ssh_command_output_contains('/sbin/hwclock -f /dev/rtc1', year);
--
2.39.2
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PULL 10/18] MAINTAINERS: Cover tests/avocado/machine_aspeed.py
2023-04-27 15:44 [PULL 00/18] testing and doc updates Alex Bennée
` (8 preceding siblings ...)
2023-04-27 15:45 ` [PULL 09/18] tests/avocado/machine_aspeed: Fix the broken ast2[56]00_evb_sdk tests Alex Bennée
@ 2023-04-27 15:45 ` Alex Bennée
2023-04-27 15:45 ` [PULL 11/18] avocado_qemu/__init__.py: factor out the qemu-img finding Alex Bennée
` (9 subsequent siblings)
19 siblings, 0 replies; 26+ messages in thread
From: Alex Bennée @ 2023-04-27 15:45 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, Thomas Huth, Cédric Le Goater,
Alex Bennée
From: Thomas Huth <thuth@redhat.com>
tests/avocado/machine_aspeed.py should belong to the ASPEED section
in the maintainers file. Improve the wildcards here a little bit,
so that it is covered, too.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20230421110345.1294131-4-thuth@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230424092249.58552-11-alex.bennee@linaro.org>
diff --git a/MAINTAINERS b/MAINTAINERS
index 214124c84c..b22b85bc3a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1113,7 +1113,7 @@ F: include/hw/misc/pca9552*.h
F: hw/net/ftgmac100.c
F: include/hw/net/ftgmac100.h
F: docs/system/arm/aspeed.rst
-F: tests/qtest/*aspeed*
+F: tests/*/*aspeed*
F: hw/arm/fby35.c
NRF51
--
2.39.2
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PULL 11/18] avocado_qemu/__init__.py: factor out the qemu-img finding
2023-04-27 15:44 [PULL 00/18] testing and doc updates Alex Bennée
` (9 preceding siblings ...)
2023-04-27 15:45 ` [PULL 10/18] MAINTAINERS: Cover tests/avocado/machine_aspeed.py Alex Bennée
@ 2023-04-27 15:45 ` Alex Bennée
2023-04-27 15:45 ` [PULL 12/18] tests/avocado/tuxrun_baselines.py: improve code coverage for ppc64 Alex Bennée
` (8 subsequent siblings)
19 siblings, 0 replies; 26+ messages in thread
From: Alex Bennée @ 2023-04-27 15:45 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, Kautuk Consul, Harsh Prateek Bora, Thomas Huth,
Philippe Mathieu-Daudé, Alex Bennée, Cleber Rosa,
Wainer dos Santos Moschetta, Beraldo Leal
From: Kautuk Consul <kconsul@linux.vnet.ibm.com>
Factor out the code that finds the qemu-img binary in the
QemuSystemTest class and create a new get_qemu_img() function
with it. This function will get called also from the new code
in tuxrun_baselines.py avocado test-case.
Signed-off-by: Kautuk Consul <kconsul@linux.vnet.ibm.com>
Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
Suggested-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230421042322.684093-2-kconsul@linux.vnet.ibm.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230424092249.58552-12-alex.bennee@linaro.org>
diff --git a/tests/avocado/avocado_qemu/__init__.py b/tests/avocado/avocado_qemu/__init__.py
index 6788837e1b..33090903f1 100644
--- a/tests/avocado/avocado_qemu/__init__.py
+++ b/tests/avocado/avocado_qemu/__init__.py
@@ -330,6 +330,19 @@ def _new_vm(self, name, *args):
vm.add_args(*args)
return vm
+ def get_qemu_img(self):
+ self.log.debug('Looking for and selecting a qemu-img binary')
+
+ # If qemu-img has been built, use it, otherwise the system wide one
+ # will be used.
+ qemu_img = os.path.join(BUILD_DIR, 'qemu-img')
+ if not os.path.exists(qemu_img):
+ qemu_img = find_command('qemu-img', False)
+ if qemu_img is False:
+ self.cancel('Could not find "qemu-img"')
+
+ return qemu_img
+
@property
def vm(self):
return self.get_vm(name='default')
@@ -602,17 +615,9 @@ def set_up_existing_ssh_keys(self):
return (ssh_public_key, ssh_private_key)
def download_boot(self):
- self.log.debug('Looking for and selecting a qemu-img binary to be '
- 'used to create the bootable snapshot image')
- # If qemu-img has been built, use it, otherwise the system wide one
- # will be used. If none is available, the test will cancel.
- qemu_img = os.path.join(BUILD_DIR, 'qemu-img')
- if not os.path.exists(qemu_img):
- qemu_img = find_command('qemu-img', False)
- if qemu_img is False:
- self.cancel('Could not find "qemu-img", which is required to '
- 'create the bootable image')
- vmimage.QEMU_IMG = qemu_img
+ # Set the qemu-img binary.
+ # If none is available, the test will cancel.
+ vmimage.QEMU_IMG = super().get_qemu_img()
self.log.info('Downloading/preparing boot image')
# Fedora 31 only provides ppc64le images
--
2.39.2
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PULL 12/18] tests/avocado/tuxrun_baselines.py: improve code coverage for ppc64
2023-04-27 15:44 [PULL 00/18] testing and doc updates Alex Bennée
` (10 preceding siblings ...)
2023-04-27 15:45 ` [PULL 11/18] avocado_qemu/__init__.py: factor out the qemu-img finding Alex Bennée
@ 2023-04-27 15:45 ` Alex Bennée
2023-04-27 15:45 ` [PULL 13/18] tests/tcg: limit the scope of the plugin tests Alex Bennée
` (7 subsequent siblings)
19 siblings, 0 replies; 26+ messages in thread
From: Alex Bennée @ 2023-04-27 15:45 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, Kautuk Consul, Alex Bennée,
Harsh Prateek Bora, Philippe Mathieu-Daudé, Thomas Huth,
Wainer dos Santos Moschetta, Beraldo Leal, Cleber Rosa
From: Kautuk Consul <kconsul@linux.vnet.ibm.com>
Commit c0c8687ef0fd990db8db1655a8a6c5a5e35dd4bb disabled the
boot_linux.py test-case due to which the code coverage for ppc
decreased by around 2%. As per the discussion on
https://lore.kernel.org/qemu-devel/87sfdpqcy4.fsf@linaro.org/ it
was mentioned that the baseline test for ppc64 could be modified
to make up this 2% code coverage. This patch attempts to achieve
this 2% code coverage by adding various device command line
arguments (to ./qemu-system-ppc64) in the tuxrun_baselines.py
test-case.
The code coverage report with boot_linux.py, without it and finally
with these tuxrun_baselines.py changes is as follows:
With boot_linux.py
------------------
lines......: 13.8% (58006 of 420997 lines)
functions..: 20.7% (7675 of 36993 functions)
branches...: 9.2% (22146 of 240611 branches)
Without boot_linux.py (without this patch changes)
--------------------------------------------------
lines......: 11.9% (50174 of 420997 lines)
functions..: 18.8% (6947 of 36993 functions)
branches...: 7.4% (17580 of 239017 branches)
Without boot_linux.py (with this patch changes)
-----------------------------------------------
lines......: 13.8% (58287 of 420997 lines)
functions..: 20.7% (7640 of 36993 functions)
branches...: 8.4% (20223 of 240611 branches)
Rebased on Alex Benee's testing/next branch:
https://gitlab.com/stsquad/qemu/-/tree/testing/next
Signed-off-by: Kautuk Consul <kconsul@linux.vnet.ibm.com>
Reported-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230424041830.1275636-1-kconsul@linux.vnet.ibm.com>
Message-Id: <20230424092249.58552-13-alex.bennee@linaro.org>
diff --git a/tests/avocado/tuxrun_baselines.py b/tests/avocado/tuxrun_baselines.py
index e8749717e9..3a46e7a745 100644
--- a/tests/avocado/tuxrun_baselines.py
+++ b/tests/avocado/tuxrun_baselines.py
@@ -11,6 +11,7 @@
import os
import time
+import tempfile
from avocado import skip, skipIf
from avocado_qemu import QemuSystemTest
@@ -72,6 +73,8 @@ def setUp(self):
# Occasionally we need extra devices to hook things up
self.extradev = self.get_tag('extradev')
+ self.qemu_img = super().get_qemu_img()
+
def wait_for_console_pattern(self, success_message, vm=None):
wait_for_console_pattern(self, success_message,
failure_message='Kernel panic - not syncing',
@@ -179,6 +182,63 @@ def common_tuxrun(self,
self.vm.launch()
self.run_tuxtest_tests(haltmsg)
+ def ppc64_common_tuxrun(self, sums, prefix):
+ # add device args to command line.
+ self.vm.add_args('-netdev', 'user,id=vnet,hostfwd=:127.0.0.1:0-:22',
+ '-device', 'virtio-net,netdev=vnet')
+ self.vm.add_args('-netdev', '{"type":"user","id":"hostnet0"}',
+ '-device', '{"driver":"virtio-net-pci","netdev":'
+ '"hostnet0","id":"net0","mac":"52:54:00:4c:e3:86",'
+ '"bus":"pci.0","addr":"0x9"}')
+ self.vm.add_args('-device', '{"driver":"qemu-xhci","p2":15,"p3":15,'
+ '"id":"usb","bus":"pci.0","addr":"0x2"}')
+ self.vm.add_args('-device', '{"driver":"virtio-scsi-pci","id":"scsi0"'
+ ',"bus":"pci.0","addr":"0x3"}')
+ self.vm.add_args('-device', '{"driver":"virtio-serial-pci","id":'
+ '"virtio-serial0","bus":"pci.0","addr":"0x4"}')
+ self.vm.add_args('-device', '{"driver":"scsi-cd","bus":"scsi0.0"'
+ ',"channel":0,"scsi-id":0,"lun":0,"device_id":'
+ '"drive-scsi0-0-0-0","id":"scsi0-0-0-0"}')
+ self.vm.add_args('-device', '{"driver":"virtio-balloon-pci",'
+ '"id":"balloon0","bus":"pci.0","addr":"0x6"}')
+ self.vm.add_args('-audiodev', '{"id":"audio1","driver":"none"}')
+ self.vm.add_args('-device', '{"driver":"usb-tablet","id":"input0"'
+ ',"bus":"usb.0","port":"1"}')
+ self.vm.add_args('-device', '{"driver":"usb-kbd","id":"input1"'
+ ',"bus":"usb.0","port":"2"}')
+ self.vm.add_args('-device', '{"driver":"VGA","id":"video0",'
+ '"vgamem_mb":16,"bus":"pci.0","addr":"0x7"}')
+ self.vm.add_args('-object', '{"qom-type":"rng-random","id":"objrng0"'
+ ',"filename":"/dev/urandom"}',
+ '-device', '{"driver":"virtio-rng-pci","rng":"objrng0"'
+ ',"id":"rng0","bus":"pci.0","addr":"0x8"}')
+ self.vm.add_args('-object', '{"qom-type":"cryptodev-backend-builtin",'
+ '"id":"objcrypto0","queues":1}',
+ '-device', '{"driver":"virtio-crypto-pci",'
+ '"cryptodev":"objcrypto0","id":"crypto0","bus"'
+ ':"pci.0","addr":"0xa"}')
+ self.vm.add_args('-device', '{"driver":"spapr-pci-host-bridge"'
+ ',"index":1,"id":"pci.1"}')
+ self.vm.add_args('-device', '{"driver":"spapr-vscsi","id":"scsi1"'
+ ',"reg":12288}')
+ self.vm.add_args('-m', '2G,slots=32,maxmem=4G',
+ '-object', 'memory-backend-ram,id=ram1,size=1G',
+ '-device', 'pc-dimm,id=dimm1,memdev=ram1')
+
+ # Create a temporary qcow2 and launch the test-case
+ with tempfile.NamedTemporaryFile(prefix=prefix,
+ suffix='.qcow2') as qcow2:
+ process.run(self.qemu_img + ' create -f qcow2 ' +
+ qcow2.name + ' 1G')
+
+ self.vm.add_args('-drive', 'file=' + qcow2.name +
+ ',format=qcow2,if=none,id='
+ 'drive-virtio-disk1',
+ '-device', 'virtio-blk-pci,scsi=off,bus=pci.0,'
+ 'addr=0xb,drive=drive-virtio-disk1,id=virtio-disk1'
+ ',bootindex=2')
+ self.common_tuxrun(csums=sums, drive="scsi-hd")
+
#
# The tests themselves. The configuration is derived from how
# tuxrun invokes qemu (with minor tweaks like using -blockdev
@@ -379,7 +439,7 @@ def test_ppc64(self):
"""
:avocado: tags=arch:ppc64
:avocado: tags=machine:pseries
- :avocado: tags=cpu:POWER8
+ :avocado: tags=cpu:POWER10
:avocado: tags=endian:big
:avocado: tags=console:hvc0
:avocado: tags=tuxboot:ppc64
@@ -391,14 +451,13 @@ def test_ppc64(self):
"1d953e81a4379e537fc8e41e05a0a59d9b453eef97aa03d47866c6c45b00bdff",
"vmlinux" :
"f22a9b9e924174a4c199f4c7e5d91a2339fcfe51c6eafd0907dc3e09b64ab728" }
-
- self.common_tuxrun(csums=sums, drive="scsi-hd")
+ self.ppc64_common_tuxrun(sums, prefix='tuxrun_ppc64_')
def test_ppc64le(self):
"""
:avocado: tags=arch:ppc64
:avocado: tags=machine:pseries
- :avocado: tags=cpu:POWER8
+ :avocado: tags=cpu:POWER10
:avocado: tags=console:hvc0
:avocado: tags=tuxboot:ppc64le
:avocado: tags=image:vmlinux
@@ -409,8 +468,7 @@ def test_ppc64le(self):
"b442678c93fb8abe1f7d3bfa20556488de6b475c22c8fed363f42cf81a0a3906",
"vmlinux" :
"979eb61b445a010fb13e2b927126991f8ceef9c590fa2be0996c00e293e80cf2" }
-
- self.common_tuxrun(csums=sums, drive="scsi-hd")
+ self.ppc64_common_tuxrun(sums, prefix='tuxrun_ppc64le_')
def test_riscv32(self):
"""
--
2.39.2
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PULL 13/18] tests/tcg: limit the scope of the plugin tests
2023-04-27 15:44 [PULL 00/18] testing and doc updates Alex Bennée
` (11 preceding siblings ...)
2023-04-27 15:45 ` [PULL 12/18] tests/avocado/tuxrun_baselines.py: improve code coverage for ppc64 Alex Bennée
@ 2023-04-27 15:45 ` Alex Bennée
2023-04-27 15:45 ` [PULL 14/18] qemu-options.hx: Update descriptions of memory options for NUMA node Alex Bennée
` (6 subsequent siblings)
19 siblings, 0 replies; 26+ messages in thread
From: Alex Bennée @ 2023-04-27 15:45 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, Alex Bennée, Philippe Mathieu-Daudé,
Peter Maydell, Edgar E. Iglesias, Paolo Bonzini, Eduardo Habkost,
David Hildenbrand, Ilya Leoshkevich, Bastian Koppelmann,
Max Filippov, open list:ARM TCG CPUs, open list:S390 TCG CPUs
Running every plugin with every test is getting excessive as well as
not really improving coverage that much. Restrict the plugin tests to
just the MULTIARCH_TESTS which are shared between most architecture
for both system and user-mode. For those that aren't we need to squash
MULTIARCH_TESTS so we don't add them when they are not part of the
TESTS global.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Acked-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230424092249.58552-14-alex.bennee@linaro.org>
diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target
index 8318caf924..72876cc84e 100644
--- a/tests/tcg/Makefile.target
+++ b/tests/tcg/Makefile.target
@@ -152,13 +152,17 @@ PLUGINS=$(patsubst %.c, lib%.so, $(notdir $(wildcard $(PLUGIN_SRC)/*.c)))
# We need to ensure expand the run-plugin-TEST-with-PLUGIN
# pre-requistes manually here as we can't use stems to handle it. We
-# also add some special helpers the run-plugin- rules can use bellow.
+# only expand MULTIARCH_TESTS which are common on most of our targets
+# to avoid an exponential explosion as new tests are added. We also
+# add some special helpers the run-plugin- rules can use bellow.
+ifneq ($(MULTIARCH_TESTS),)
$(foreach p,$(PLUGINS), \
- $(foreach t,$(TESTS),\
+ $(foreach t,$(MULTIARCH_TESTS),\
$(eval run-plugin-$(t)-with-$(p): $t $p) \
$(eval RUN_TESTS+=run-plugin-$(t)-with-$(p))))
-endif
+endif # MULTIARCH_TESTS
+endif # CONFIG_PLUGIN
strip-plugin = $(wordlist 1, 1, $(subst -with-, ,$1))
extract-plugin = $(wordlist 2, 2, $(subst -with-, ,$1))
diff --git a/tests/tcg/aarch64/Makefile.softmmu-target b/tests/tcg/aarch64/Makefile.softmmu-target
index df9747bae8..b74a2534e3 100644
--- a/tests/tcg/aarch64/Makefile.softmmu-target
+++ b/tests/tcg/aarch64/Makefile.softmmu-target
@@ -81,6 +81,4 @@ pauth-3:
$(call skip-test, "BUILD of $@", "missing compiler support")
run-pauth-3:
$(call skip-test, "RUN of pauth-3", "not built")
-run-plugin-pauth-3-with-%:
- $(call skip-test, "RUN of pauth-3 ($*)", "not built")
endif
diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile.target
index 9e91a20b0d..0315795487 100644
--- a/tests/tcg/aarch64/Makefile.target
+++ b/tests/tcg/aarch64/Makefile.target
@@ -32,7 +32,6 @@ ifneq ($(CROSS_CC_HAS_ARMV8_3),)
AARCH64_TESTS += pauth-1 pauth-2 pauth-4 pauth-5
pauth-%: CFLAGS += -march=armv8.3-a
run-pauth-%: QEMU_OPTS += -cpu max
-run-plugin-pauth-%: QEMU_OPTS += -cpu max
endif
# BTI Tests
diff --git a/tests/tcg/arm/Makefile.softmmu-target b/tests/tcg/arm/Makefile.softmmu-target
index 7df88ddea8..8b546e2aa3 100644
--- a/tests/tcg/arm/Makefile.softmmu-target
+++ b/tests/tcg/arm/Makefile.softmmu-target
@@ -23,4 +23,6 @@ LDFLAGS+=-nostdlib -N -static
test-armv6m-undef: EXTRA_CFLAGS+=-mcpu=cortex-m0 -mfloat-abi=soft
run-test-armv6m-undef: QEMU_OPTS+=-semihosting -M microbit -kernel
-run-plugin-test-armv6m-undef-%: QEMU_OPTS+=-semihosting -M microbit -kernel
+
+# We don't currently support the multiarch system tests
+undefine MULTIARCH_TESTS
diff --git a/tests/tcg/arm/Makefile.target b/tests/tcg/arm/Makefile.target
index b3b1504a1c..0038cef02c 100644
--- a/tests/tcg/arm/Makefile.target
+++ b/tests/tcg/arm/Makefile.target
@@ -46,11 +46,6 @@ semihosting-arm: semihosting.c
run-semihosting-arm: semihosting-arm
$(call run-test,$<,$(QEMU) $< 2> $<.err)
-run-plugin-semihosting-arm-with-%:
- $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \
- -plugin $(PLUGIN_LIB)/$(call extract-plugin,$@) \
- $(call strip-plugin,$<) 2> $<.err)
-
ARM_TESTS += semiconsole-arm
semiconsole: CFLAGS += -mthumb
@@ -62,9 +57,6 @@ semiconsole-arm: semihosting.c
run-semiconsole-arm: semiconsole-arm
$(call skip-test, $<, "MANUAL ONLY")
-run-plugin-semiconsole-arm-with-%:
- $(call skip-test, $<, "MANUAL ONLY")
-
endif
ARM_TESTS += commpage
diff --git a/tests/tcg/cris/Makefile.target b/tests/tcg/cris/Makefile.target
index 372287bd03..43587d2769 100644
--- a/tests/tcg/cris/Makefile.target
+++ b/tests/tcg/cris/Makefile.target
@@ -57,3 +57,6 @@ SIMG:=cris-axis-linux-gnu-run
# e.g.: make -f ../../tests/tcg/Makefile run-check_orm-on-sim
run-%-on-sim:
$(call run-test, $<, $(SIMG) $<)
+
+# We don't currently support the multiarch tests
+undefine MULTIARCH_TESTS
diff --git a/tests/tcg/hppa/Makefile.target b/tests/tcg/hppa/Makefile.target
index b78e6b4849..cdd0d572a7 100644
--- a/tests/tcg/hppa/Makefile.target
+++ b/tests/tcg/hppa/Makefile.target
@@ -10,8 +10,6 @@ EXTRA_RUNS+=run-test-mmap-4096 # run-test-mmap-16384 run-test-mmap-65536
# it requires the full vdso with dwarf2 unwind info.
run-signals: signals
$(call skip-test, $<, "BROKEN awaiting vdso support")
-run-plugin-signals-with-%:
- $(call skip-test, $<, "BROKEN awaiting vdso support")
VPATH += $(SRC_PATH)/tests/tcg/hppa
TESTS += stby
diff --git a/tests/tcg/i386/Makefile.target b/tests/tcg/i386/Makefile.target
index bafd8c2180..821822ed0c 100644
--- a/tests/tcg/i386/Makefile.target
+++ b/tests/tcg/i386/Makefile.target
@@ -18,19 +18,15 @@ X86_64_TESTS:=$(filter test-i386-adcox test-i386-bmi2 $(SKIP_I386_TESTS), $(ALL_
test-i386-sse-exceptions: CFLAGS += -msse4.1 -mfpmath=sse
run-test-i386-sse-exceptions: QEMU_OPTS += -cpu max
-run-plugin-test-i386-sse-exceptions-%: QEMU_OPTS += -cpu max
test-i386-pcmpistri: CFLAGS += -msse4.2
run-test-i386-pcmpistri: QEMU_OPTS += -cpu max
-run-plugin-test-i386-pcmpistri-%: QEMU_OPTS += -cpu max
test-i386-bmi2: CFLAGS=-O2
run-test-i386-bmi2: QEMU_OPTS += -cpu max
-run-plugin-test-i386-bmi2-%: QEMU_OPTS += -cpu max
test-i386-adcox: CFLAGS=-O2
run-test-i386-adcox: QEMU_OPTS += -cpu max
-run-plugin-test-i386-adcox-%: QEMU_OPTS += -cpu max
#
# hello-i386 is a barebones app
@@ -52,8 +48,6 @@ test-i386:
$(call skip-test, "BUILD of $@", "missing -no-pie compiler support")
run-test-i386:
$(call skip-test, "RUN of test-i386", "not built")
-run-plugin-test-i386-with-%:
- $(call skip-test, "RUN of test-i386 ($*)", "not built")
endif
ifeq ($(SPEED), slow)
@@ -87,7 +81,6 @@ sha512-sse: sha512.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
run-sha512-sse: QEMU_OPTS+=-cpu max
-run-plugin-sha512-sse-with-%: QEMU_OPTS+=-cpu max
TESTS+=sha512-sse
@@ -103,15 +96,12 @@ test-avx.h: test-avx.py x86.csv
test-3dnow: CFLAGS += -masm=intel -O -I.
run-test-3dnow: QEMU_OPTS += -cpu max
-run-plugin-test-3dnow: QEMU_OPTS += -cpu max
test-3dnow: test-3dnow.h
test-mmx: CFLAGS += -masm=intel -O -I.
run-test-mmx: QEMU_OPTS += -cpu max
-run-plugin-test-mmx: QEMU_OPTS += -cpu max
test-mmx: test-mmx.h
test-avx: CFLAGS += -mavx -masm=intel -O -I.
run-test-avx: QEMU_OPTS += -cpu max
-run-plugin-test-avx: QEMU_OPTS += -cpu max
test-avx: test-avx.h
diff --git a/tests/tcg/ppc64/Makefile.target b/tests/tcg/ppc64/Makefile.target
index f081f1c683..6d47d3cae6 100644
--- a/tests/tcg/ppc64/Makefile.target
+++ b/tests/tcg/ppc64/Makefile.target
@@ -24,14 +24,12 @@ PPC64_TESTS += byte_reverse sha512-vector
endif
byte_reverse: CFLAGS += -mcpu=power10
run-byte_reverse: QEMU_OPTS+=-cpu POWER10
-run-plugin-byte_reverse-with-%: QEMU_OPTS+=-cpu POWER10
sha512-vector: CFLAGS +=-mcpu=power10 -O3
sha512-vector: sha512.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS)
run-sha512-vector: QEMU_OPTS+=-cpu POWER10
-run-plugin-sha512-vector-with-%: QEMU_OPTS+=-cpu POWER10
PPC64_TESTS += signal_save_restore_xer
PPC64_TESTS += xxspltw
diff --git a/tests/tcg/riscv64/Makefile.softmmu-target b/tests/tcg/riscv64/Makefile.softmmu-target
index e22cdb34c5..d5b126e5f1 100644
--- a/tests/tcg/riscv64/Makefile.softmmu-target
+++ b/tests/tcg/riscv64/Makefile.softmmu-target
@@ -19,3 +19,6 @@ QEMU_OPTS += -M virt -display none -semihosting -device loader,file=
EXTRA_RUNS += run-issue1060
run-issue1060: issue1060
$(call run-test, $<, $(QEMU) $(QEMU_OPTS)$<)
+
+# We don't currently support the multiarch system tests
+undefine MULTIARCH_TESTS
diff --git a/tests/tcg/riscv64/Makefile.target b/tests/tcg/riscv64/Makefile.target
index cc3ed65ffd..9973ba3b5f 100644
--- a/tests/tcg/riscv64/Makefile.target
+++ b/tests/tcg/riscv64/Makefile.target
@@ -9,4 +9,3 @@ TESTS += noexec
TESTS += test-noc
test-noc: LDFLAGS = -nostdlib -static
run-test-noc: QEMU_OPTS += -cpu rv64,c=false
-run-plugin-test-noc-%: QEMU_OPTS += -cpu rv64,c=false
diff --git a/tests/tcg/s390x/Makefile.softmmu-target b/tests/tcg/s390x/Makefile.softmmu-target
index 3e7f72abcd..192315dd20 100644
--- a/tests/tcg/s390x/Makefile.softmmu-target
+++ b/tests/tcg/s390x/Makefile.softmmu-target
@@ -23,3 +23,6 @@ include $(S390X_SRC)/pgm-specification.mak
$(PGM_SPECIFICATION_TESTS): pgm-specification-softmmu.o
$(PGM_SPECIFICATION_TESTS): LDFLAGS+=pgm-specification-softmmu.o
TESTS += $(PGM_SPECIFICATION_TESTS)
+
+# We don't currently support the multiarch system tests
+undefine MULTIARCH_TESTS
diff --git a/tests/tcg/tricore/Makefile.softmmu-target b/tests/tcg/tricore/Makefile.softmmu-target
index b3cd56fffc..49e573bc3b 100644
--- a/tests/tcg/tricore/Makefile.softmmu-target
+++ b/tests/tcg/tricore/Makefile.softmmu-target
@@ -29,3 +29,6 @@ QEMU_OPTS += -M tricore_testboard -cpu tc27x -nographic -kernel
%.tst: %.o
$(LD) $(LDFLAGS) $< -o $@
+
+# We don't currently support the multiarch system tests
+undefine MULTIARCH_TESTS
diff --git a/tests/tcg/xtensa/Makefile.softmmu-target b/tests/tcg/xtensa/Makefile.softmmu-target
index ba6cd9fde3..78bf72dfaa 100644
--- a/tests/tcg/xtensa/Makefile.softmmu-target
+++ b/tests/tcg/xtensa/Makefile.softmmu-target
@@ -41,3 +41,6 @@ $(XTENSA_USABLE_TESTS): linker.ld macros.inc $(CRT) Makefile.softmmu-target
$(CC) $(XTENSA_INC) $(ASFLAGS) $(EXTRA_CFLAGS) $< -o $@ $(LDFLAGS) $(NOSTDFLAGS) $(CRT)
endif
+
+# We don't currently support the multiarch system tests
+undefine MULTIARCH_TESTS
--
2.39.2
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PULL 14/18] qemu-options.hx: Update descriptions of memory options for NUMA node
2023-04-27 15:44 [PULL 00/18] testing and doc updates Alex Bennée
` (12 preceding siblings ...)
2023-04-27 15:45 ` [PULL 13/18] tests/tcg: limit the scope of the plugin tests Alex Bennée
@ 2023-04-27 15:45 ` Alex Bennée
2023-04-27 15:45 ` [PULL 15/18] docs/system: remove excessive punctuation from guest-loader docs Alex Bennée
` (5 subsequent siblings)
19 siblings, 0 replies; 26+ messages in thread
From: Alex Bennée @ 2023-04-27 15:45 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, Yohei Kojima, Juan Quintela, Alex Bennée
From: Yohei Kojima <y-koj@outlook.jp>
This commit adds the following description:
1. `memdev` option is recommended over `mem` option (see [1,2])
2. users must specify memory for all NUMA nodes (see [2])
This commit also separates descriptions for `mem` and `memdev` into two
paragraphs. The old doc describes legacy `mem` option first, and it was
a bit confusing.
Related documentation:
[1] https://wiki.qemu.org/ChangeLog/5.1#Incompatible_changes
[2] https://www.qemu.org/docs/master/about/removed-features.html
Signed-off-by: Yohei Kojima <y-koj@outlook.jp>
Message-Id: <TYZPR06MB5418D6B0175A49E8E76988439D8E9@TYZPR06MB5418.apcprd06.prod.outlook.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
[AJB: fix documentation in commit message]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20230424092249.58552-15-alex.bennee@linaro.org>
diff --git a/qemu-options.hx b/qemu-options.hx
index baa0589733..b5efa648ba 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -405,15 +405,22 @@ SRST
-numa node,nodeid=0 -numa node,nodeid=1 \
-numa cpu,node-id=0,socket-id=0 -numa cpu,node-id=1,socket-id=1
- Legacy '\ ``mem``\ ' assigns a given RAM amount to a node (not supported
- for 5.1 and newer machine types). '\ ``memdev``\ ' assigns RAM from
- a given memory backend device to a node. If '\ ``mem``\ ' and
- '\ ``memdev``\ ' are omitted in all nodes, RAM is split equally between them.
-
-
- '\ ``mem``\ ' and '\ ``memdev``\ ' are mutually exclusive.
- Furthermore, if one node uses '\ ``memdev``\ ', all of them have to
- use it.
+ '\ ``memdev``\ ' option assigns RAM from a given memory backend
+ device to a node. It is recommended to use '\ ``memdev``\ ' option
+ over legacy '\ ``mem``\ ' option. This is because '\ ``memdev``\ '
+ option provides better performance and more control over the
+ backend's RAM (e.g. '\ ``prealloc``\ ' parameter of
+ '\ ``-memory-backend-ram``\ ' allows memory preallocation).
+
+ For compatibility reasons, legacy '\ ``mem``\ ' option is
+ supported in 5.0 and older machine types. Note that '\ ``mem``\ '
+ and '\ ``memdev``\ ' are mutually exclusive. If one node uses
+ '\ ``memdev``\ ', the rest nodes have to use '\ ``memdev``\ '
+ option, and vice versa.
+
+ Users must specify memory for all NUMA nodes by '\ ``memdev``\ '
+ (or legacy '\ ``mem``\ ' if available). In QEMU 5.2, the support
+ for '\ ``-numa node``\ ' without memory specified was removed.
'\ ``initiator``\ ' is an additional option that points to an
initiator NUMA node that has best performance (the lowest latency or
--
2.39.2
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PULL 15/18] docs/system: remove excessive punctuation from guest-loader docs
2023-04-27 15:44 [PULL 00/18] testing and doc updates Alex Bennée
` (13 preceding siblings ...)
2023-04-27 15:45 ` [PULL 14/18] qemu-options.hx: Update descriptions of memory options for NUMA node Alex Bennée
@ 2023-04-27 15:45 ` Alex Bennée
2023-04-27 15:45 ` [PULL 16/18] docs/devel: make a statement about includes Alex Bennée
` (4 subsequent siblings)
19 siblings, 0 replies; 26+ messages in thread
From: Alex Bennée @ 2023-04-27 15:45 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, Alex Bennée, Juan Quintela, Thomas Huth
A possessive its needs no ' whereas the contraction of it is does.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20230424092249.58552-16-alex.bennee@linaro.org>
diff --git a/docs/system/guest-loader.rst b/docs/system/guest-loader.rst
index 9ef9776bf0..304ee5d531 100644
--- a/docs/system/guest-loader.rst
+++ b/docs/system/guest-loader.rst
@@ -14,7 +14,7 @@ The guest loader does two things:
- load blobs (kernels and initial ram disks) into memory
- sets platform FDT data so hypervisors can find and boot them
-This is what is typically done by a boot-loader like grub using it's
+This is what is typically done by a boot-loader like grub using its
multi-boot capability. A typical example would look like:
.. parsed-literal::
@@ -25,9 +25,9 @@ multi-boot capability. A typical example would look like:
-device guest-loader,addr=0x47000000,initrd=rootfs.cpio
In the above example the Xen hypervisor is loaded by the -kernel
-parameter and passed it's boot arguments via -append. The Dom0 guest
+parameter and passed its boot arguments via -append. The Dom0 guest
is loaded into the areas of memory. Each blob will get
-``/chosen/module@<addr>`` entry in the FDT to indicate it's location and
+``/chosen/module@<addr>`` entry in the FDT to indicate its location and
size. Additional information can be passed with by using additional
arguments.
--
2.39.2
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PULL 16/18] docs/devel: make a statement about includes
2023-04-27 15:44 [PULL 00/18] testing and doc updates Alex Bennée
` (14 preceding siblings ...)
2023-04-27 15:45 ` [PULL 15/18] docs/system: remove excessive punctuation from guest-loader docs Alex Bennée
@ 2023-04-27 15:45 ` Alex Bennée
2023-04-27 15:45 ` [PULL 17/18] docs/devel: mention the spacing requirement for QOM Alex Bennée
` (3 subsequent siblings)
19 siblings, 0 replies; 26+ messages in thread
From: Alex Bennée @ 2023-04-27 15:45 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, Alex Bennée, Juan Quintela,
Daniel P. Berrangé, Thomas Huth, Markus Armbruster,
Philippe Mathieu-Daudé
While not explicitly disallowing header macro abuse (because that
would make us hypocrites) lets at least address some things to think
about.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230424092249.58552-17-alex.bennee@linaro.org>
diff --git a/docs/devel/style.rst b/docs/devel/style.rst
index 68aa776930..5bc6f2f095 100644
--- a/docs/devel/style.rst
+++ b/docs/devel/style.rst
@@ -300,6 +300,20 @@ putting those into qemu/typedefs.h instead of including the header.
Cyclic inclusion is forbidden.
+Generative Includes
+-------------------
+
+QEMU makes fairly extensive use of the macro pre-processor to
+instantiate multiple similar functions. While such abuse of the macro
+processor isn't discouraged it can make debugging and code navigation
+harder. You should consider carefully if the same effect can be
+achieved by making it easy for the compiler to constant fold or using
+python scripting to generate grep friendly code.
+
+If you do use template header files they should be named with the
+``.c.inc`` or ``.h.inc`` suffix to make it clear they are being
+included for expansion.
+
C types
=======
--
2.39.2
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PULL 17/18] docs/devel: mention the spacing requirement for QOM
2023-04-27 15:44 [PULL 00/18] testing and doc updates Alex Bennée
` (15 preceding siblings ...)
2023-04-27 15:45 ` [PULL 16/18] docs/devel: make a statement about includes Alex Bennée
@ 2023-04-27 15:45 ` Alex Bennée
2023-04-27 15:45 ` [PULL 18/18] docs/style: call out the use of GUARD macros Alex Bennée
` (2 subsequent siblings)
19 siblings, 0 replies; 26+ messages in thread
From: Alex Bennée @ 2023-04-27 15:45 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, Alex Bennée, Juan Quintela,
Mark Cave-Ayland, Paolo Bonzini, Daniel P. Berrangé,
Eduardo Habkost, Thomas Huth, Markus Armbruster,
Philippe Mathieu-Daudé
We have a more complete document on QOM but we should at least mention
the style requirements in the style guide.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20230424092249.58552-18-alex.bennee@linaro.org>
diff --git a/docs/devel/qom.rst b/docs/devel/qom.rst
index 3e34b07c98..c9237950d0 100644
--- a/docs/devel/qom.rst
+++ b/docs/devel/qom.rst
@@ -1,3 +1,5 @@
+.. _qom:
+
===========================
The QEMU Object Model (QOM)
===========================
diff --git a/docs/devel/style.rst b/docs/devel/style.rst
index 5bc6f2f095..ac2ce42a2f 100644
--- a/docs/devel/style.rst
+++ b/docs/devel/style.rst
@@ -628,6 +628,43 @@ are still some caveats to beware of
QEMU Specific Idioms
********************
+QEMU Object Model Declarations
+==============================
+
+The QEMU Object Model (QOM) provides a framework for handling objects
+in the base C language. The first declaration of a storage or class
+structure should always be the parent and leave a visual space between
+that declaration and the new code. It is also useful to separate
+backing for properties (options driven by the user) and internal state
+to make navigation easier.
+
+For a storage structure the first declaration should always be called
+"parent_obj" and for a class structure the first member should always
+be called "parent_class" as below:
+
+.. code-block:: c
+
+ struct MyDeviceState {
+ DeviceState parent_obj;
+
+ /* Properties */
+ int prop_a;
+ char *prop_b;
+ /* Other stuff */
+ int internal_state;
+ };
+
+ struct MyDeviceClass {
+ DeviceClass parent_class;
+
+ void (*new_fn1)(void);
+ bool (*new_fn2)(CPUState *);
+ };
+
+Note that there is no need to provide typedefs for QOM structures
+since these are generated automatically by the QOM declaration macros.
+See :ref:`qom` for more details.
+
Error handling and reporting
============================
--
2.39.2
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PULL 18/18] docs/style: call out the use of GUARD macros
2023-04-27 15:44 [PULL 00/18] testing and doc updates Alex Bennée
` (16 preceding siblings ...)
2023-04-27 15:45 ` [PULL 17/18] docs/devel: mention the spacing requirement for QOM Alex Bennée
@ 2023-04-27 15:45 ` Alex Bennée
2023-04-28 7:34 ` [PULL 00/18] testing and doc updates Richard Henderson
2023-05-02 11:46 ` Peter Maydell
19 siblings, 0 replies; 26+ messages in thread
From: Alex Bennée @ 2023-04-27 15:45 UTC (permalink / raw)
To: qemu-devel
Cc: richard.henderson, Alex Bennée, Philippe Mathieu-Daudé,
Juan Quintela, Vladimir Sementsov-Ogievskiy,
Daniel P. Berrangé, Thomas Huth, Markus Armbruster
There use makes our code safer so we should mention them.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Message-Id: <20230424092249.58552-19-alex.bennee@linaro.org>
diff --git a/docs/devel/style.rst b/docs/devel/style.rst
index ac2ce42a2f..aa5e083ff8 100644
--- a/docs/devel/style.rst
+++ b/docs/devel/style.rst
@@ -665,6 +665,60 @@ Note that there is no need to provide typedefs for QOM structures
since these are generated automatically by the QOM declaration macros.
See :ref:`qom` for more details.
+QEMU GUARD macros
+=================
+
+QEMU provides a number of ``_GUARD`` macros intended to make the
+handling of multiple exit paths easier. For example using
+``QEMU_LOCK_GUARD`` to take a lock will ensure the lock is released on
+exit from the function.
+
+.. code-block:: c
+
+ static int my_critical_function(SomeState *s, void *data)
+ {
+ QEMU_LOCK_GUARD(&s->lock);
+ do_thing1(data);
+ if (check_state2(data)) {
+ return -1;
+ }
+ do_thing3(data);
+ return 0;
+ }
+
+will ensure s->lock is released however the function is exited. The
+equivalent code without _GUARD macro makes us to carefully put
+qemu_mutex_unlock() on all exit points:
+
+.. code-block:: c
+
+ static int my_critical_function(SomeState *s, void *data)
+ {
+ qemu_mutex_lock(&s->lock);
+ do_thing1(data);
+ if (check_state2(data)) {
+ qemu_mutex_unlock(&s->lock);
+ return -1;
+ }
+ do_thing3(data);
+ qemu_mutex_unlock(&s->lock);
+ return 0;
+ }
+
+There are often ``WITH_`` forms of macros which more easily wrap
+around a block inside a function.
+
+.. code-block:: c
+
+ WITH_RCU_READ_LOCK_GUARD() {
+ QTAILQ_FOREACH_RCU(kid, &bus->children, sibling) {
+ err = do_the_thing(kid->child);
+ if (err < 0) {
+ return err;
+ }
+ }
+ }
+
Error handling and reporting
============================
--
2.39.2
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PULL 00/18] testing and doc updates
2023-04-27 15:44 [PULL 00/18] testing and doc updates Alex Bennée
` (17 preceding siblings ...)
2023-04-27 15:45 ` [PULL 18/18] docs/style: call out the use of GUARD macros Alex Bennée
@ 2023-04-28 7:34 ` Richard Henderson
2023-05-02 11:46 ` Peter Maydell
19 siblings, 0 replies; 26+ messages in thread
From: Richard Henderson @ 2023-04-28 7:34 UTC (permalink / raw)
To: Alex Bennée, qemu-devel
On 4/27/23 16:44, Alex Bennée wrote:
> The following changes since commit 1eb95e1baef852d0971a1dd62a3293cd68f1ec35:
>
> Merge tag 'migration-20230426-pull-request' ofhttps://gitlab.com/juan.quintela/qemu into staging (2023-04-27 10:47:14 +0100)
>
> are available in the Git repository at:
>
> https://gitlab.com/stsquad/qemu.git tags/pull-testing-docs-270423-1
>
> for you to fetch changes up to ef46ae67ba9a785cf0cce58b5fc5a36ed3c6c7b9:
>
> docs/style: call out the use of GUARD macros (2023-04-27 14:58:51 +0100)
>
> ----------------------------------------------------------------
> Testing and documentation updates:
>
> - bump avocado to 101.0
> - use snapshots for tuxrun baseline tests
> - add sbda-ref test to avocado
> - avoid spurious re-configure in gitlab
> - better description of blockdev options
> - drop FreeBSD 12 from Cirrus CI
> - fix up the ast2[56]00 tests to be more stable
> - improve coverage of ppc64 tests in tuxrun baselines
> - limit plugin tests to just the generic multiarch binaries
Applied, thanks. Please update https://wiki.qemu.org/ChangeLog/8.1 as appropriate.
r~
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PULL 00/18] testing and doc updates
2023-04-27 15:44 [PULL 00/18] testing and doc updates Alex Bennée
` (18 preceding siblings ...)
2023-04-28 7:34 ` [PULL 00/18] testing and doc updates Richard Henderson
@ 2023-05-02 11:46 ` Peter Maydell
2023-05-02 12:21 ` Thomas Huth
19 siblings, 1 reply; 26+ messages in thread
From: Peter Maydell @ 2023-05-02 11:46 UTC (permalink / raw)
To: Alex Bennée; +Cc: qemu-devel, richard.henderson
On Thu, 27 Apr 2023 at 16:47, Alex Bennée <alex.bennee@linaro.org> wrote:
>
> The following changes since commit 1eb95e1baef852d0971a1dd62a3293cd68f1ec35:
>
> Merge tag 'migration-20230426-pull-request' of https://gitlab.com/juan.quintela/qemu into staging (2023-04-27 10:47:14 +0100)
>
> are available in the Git repository at:
>
> https://gitlab.com/stsquad/qemu.git tags/pull-testing-docs-270423-1
>
> for you to fetch changes up to ef46ae67ba9a785cf0cce58b5fc5a36ed3c6c7b9:
>
> docs/style: call out the use of GUARD macros (2023-04-27 14:58:51 +0100)
>
> ----------------------------------------------------------------
> Testing and documentation updates:
>
> - bump avocado to 101.0
Did this change the behaviour of 'make check-avocado' ?
Previously it would continue the whole test run even if one
test timed out; now it seems to abort the test run when the
first test times out.
I don't object to the current behaviour, but is there some
command line option I can use to force avocado to complete
the whole test set even if there are failures or timeouts?
('make check-avocado' for arm targets has some persistent
intermittent timeout stuff still, so I generally prefer to
eyeball the failures and ignore the stuff I know is flaky.)
thanks
-- PMM
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PULL 00/18] testing and doc updates
2023-05-02 11:46 ` Peter Maydell
@ 2023-05-02 12:21 ` Thomas Huth
0 siblings, 0 replies; 26+ messages in thread
From: Thomas Huth @ 2023-05-02 12:21 UTC (permalink / raw)
To: Peter Maydell, Alex Bennée, Cleber Rosa
Cc: qemu-devel, richard.henderson
On 02/05/2023 13.46, Peter Maydell wrote:
> On Thu, 27 Apr 2023 at 16:47, Alex Bennée <alex.bennee@linaro.org> wrote:
>>
>> The following changes since commit 1eb95e1baef852d0971a1dd62a3293cd68f1ec35:
>>
>> Merge tag 'migration-20230426-pull-request' of https://gitlab.com/juan.quintela/qemu into staging (2023-04-27 10:47:14 +0100)
>>
>> are available in the Git repository at:
>>
>> https://gitlab.com/stsquad/qemu.git tags/pull-testing-docs-270423-1
>>
>> for you to fetch changes up to ef46ae67ba9a785cf0cce58b5fc5a36ed3c6c7b9:
>>
>> docs/style: call out the use of GUARD macros (2023-04-27 14:58:51 +0100)
>>
>> ----------------------------------------------------------------
>> Testing and documentation updates:
>>
>> - bump avocado to 101.0
>
> Did this change the behaviour of 'make check-avocado' ?
> Previously it would continue the whole test run even if one
> test timed out; now it seems to abort the test run when the
> first test times out.
>
> I don't object to the current behaviour, but is there some
> command line option I can use to force avocado to complete
> the whole test set even if there are failures or timeouts?
>
> ('make check-avocado' for arm targets has some persistent
> intermittent timeout stuff still, so I generally prefer to
> eyeball the failures and ignore the stuff I know is flaky.)
I think I've seen it in the past, too:
https://lore.kernel.org/qemu-devel/7836af42-9969-a01a-3c8c-717987b0b27e@redhat.com/
... but after Cleber said that there is no change in behavior, I did not
follow up. Anyway, it is likely related to that --failfast switch of
Avocado, so that's likely the first thing to look for, I guess...
Thomas
^ permalink raw reply [flat|nested] 26+ messages in thread