support/testing: override the EDK2 CPU hotplug bug check

In QEMU v5.1.0 up to v7.2.0, the CPU hotplug register block misbehaves.
EDK2 hang if the bug is detected in Qemu after printing errors to IO port 0x402
(requires BR2_TARGET_EDK2_OVMF_DEBUG_ON_SERIAL to see them)

The Docker image used by the Buildroot gitlab-ci uses Qemu 5.2.0, the workaround
can be removed as soon as the Docker image is updated to provided Qemu >= 8.0.0.

bf5678b580
http://lists.busybox.net/pipermail/buildroot/2023-July/670825.html

Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/4725186190 (TestGrubX8664EFI)
https://gitlab.com/buildroot.org/buildroot/-/jobs/4725186198 (TestGrubi386EFI)
https://gitlab.com/buildroot.org/buildroot/-/jobs/4725186306 (TestIso9660Grub2EFI)
https://gitlab.com/buildroot.org/buildroot/-/jobs/4725186317 (TestIso9660Grub2Hybrid)

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Julien Olivain <ju.o@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Romain Naour 2023-07-29 00:53:54 +02:00 committed by Thomas Petazzoni
parent 9d6f966f9a
commit d0e2e420c9
2 changed files with 28 additions and 3 deletions

View File

@ -61,7 +61,15 @@ class TestGrubi386EFI(infra.basetest.BRTest):
def test_run(self):
hda = os.path.join(self.builddir, "images", "disk.img")
bios = os.path.join(self.builddir, "images", "OVMF.fd")
self.emulator.boot(arch="i386", options=["-bios", bios, "-hda", hda])
# In QEMU v5.1.0 up to v7.2.0, the CPU hotplug register block misbehaves.
# EDK2 hang if the bug is detected in Qemu after printing errors to IO port 0x402
# (requires BR2_TARGET_EDK2_OVMF_DEBUG_ON_SERIAL to see them)
# The Docker image used by the Buildroot gitlab-ci uses Qemu 5.2.0, the workaround
# can be removed as soon as the Docker image is updated to provided Qemu >= 8.0.0.
# https://github.com/tianocore/edk2/commit/bf5678b5802685e07583e3c7ec56d883cbdd5da3
# http://lists.busybox.net/pipermail/buildroot/2023-July/670825.html
qemu_fw_cfg = "name=opt/org.tianocore/X-Cpuhp-Bugcheck-Override,string=yes"
self.emulator.boot(arch="i386", options=["-bios", bios, "-hda", hda, "-fw_cfg", qemu_fw_cfg])
self.emulator.login()
cmd = "modprobe efivarfs"
@ -104,7 +112,15 @@ class TestGrubX8664EFI(infra.basetest.BRTest):
def test_run(self):
hda = os.path.join(self.builddir, "images", "disk.img")
bios = os.path.join(self.builddir, "images", "OVMF.fd")
self.emulator.boot(arch="x86_64", options=["-bios", bios, "-hda", hda])
# In QEMU v5.1.0 up to v7.2.0, the CPU hotplug register block misbehaves.
# EDK2 hang if the bug is detected in Qemu after printing errors to IO port 0x402
# (requires BR2_TARGET_EDK2_OVMF_DEBUG_ON_SERIAL to see them)
# The Docker image used by the Buildroot gitlab-ci uses Qemu 5.2.0, the workaround
# can be removed as soon as the Docker image is updated to provided Qemu >= 8.0.0.
# https://github.com/tianocore/edk2/commit/bf5678b5802685e07583e3c7ec56d883cbdd5da3
# http://lists.busybox.net/pipermail/buildroot/2023-July/670825.html
qemu_fw_cfg = "name=opt/org.tianocore/X-Cpuhp-Bugcheck-Override,string=yes"
self.emulator.boot(arch="x86_64", options=["-bios", bios, "-hda", hda, "-fw_cfg", qemu_fw_cfg])
self.emulator.login()
cmd = "modprobe efivarfs"

View File

@ -29,7 +29,16 @@ def test_mount_internal_external(emulator, builddir, internal=True, efi=False):
img = os.path.join(builddir, "images", "rootfs.iso9660")
if efi:
efi_img = os.path.join(builddir, "images", "OVMF.fd")
emulator.boot(arch="i386", options=["-cdrom", img, "-bios", efi_img])
# In QEMU v5.1.0 up to v7.2.0, the CPU hotplug register block misbehaves.
# EDK2 hang if the bug is detected in Qemu after printing errors to IO port 0x402
# (requires BR2_TARGET_EDK2_OVMF_DEBUG_ON_SERIAL to see them)
# The Docker image used by the Buildroot gitlab-ci uses Qemu 5.2.0, the workaround
# can be removed as soon as the Docker image is updated to provided Qemu >= 8.0.0.
# This workaround is needed only when efi=True since it imply EDK2 is used.
# https://github.com/tianocore/edk2/commit/bf5678b5802685e07583e3c7ec56d883cbdd5da3
# http://lists.busybox.net/pipermail/buildroot/2023-July/670825.html
qemu_fw_cfg = "name=opt/org.tianocore/X-Cpuhp-Bugcheck-Override,string=yes"
emulator.boot(arch="i386", options=["-cdrom", img, "-bios", efi_img, "-fw_cfg", qemu_fw_cfg])
else:
emulator.boot(arch="i386", options=["-cdrom", img])
emulator.login()