support/testing: use Nehalem cpu emulation for TestGrubX8664EFI

In commit 7e0e6e3b86 (toolchain/toolchain-external/toolchain-external-bootlin:
update to 2023.11-1) the TestGrubX8664EFI fails with this error:

  # efivar -l
  traps: efivar[86] trap invalid opcode ip:7fc187f4c7f4 sp:7fff9bbaa930 error:0 in libefivar.so.1.38[7fc187f4c000+16000]
  Illegal instruction

This error can be reproduced by installing other packages like "file".

The 2023.11-1 Bootlin toolchains are built for a corei7 CPU [0], which
is in fact a Nehalem CPU; we switched to the new names in commit
653fa001f3 (arch/Config.in.x86: add "newer" names for several Intel
x86 CPU variants). This means that the Bootlin toolchains may use
Nehalem-specific instructions.

The TestGrubX8664EFI test is also setup for BR2_x86_corei7, so our
executables will also contain Nehalem instructions.

However, the default Qemu x86_64 is not guaranteed to emulate all the
instructions specific to Nehalem, causing runtime issues as reported
above.

A similar issue has been fixed in toolchain-builder by adding Nehalem
cpu emulation on the qemu command line [0].

Fixes: https://gitlab.com/buildroot.org/buildroot/-/jobs/6093853712

[0] f2b253732b

Signed-off-by: Romain Naour <romain.naour@smile.fr>
[yann.morin.1998@free.fr:
  - reword the commit log to explain corei7 -> Nehalem equivalence
  - note that the toolchain-builder *and* our test target corei7, thus
    Nehalem
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
This commit is contained in:
Romain Naour 2024-02-05 14:35:30 +01:00 committed by Yann E. MORIN
parent 6ff00badaa
commit 4f565b5222

View File

@ -120,7 +120,7 @@ class TestGrubX8664EFI(infra.basetest.BRTest):
# 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.boot(arch="x86_64", options=["-bios", bios, "-cpu", "Nehalem", "-hda", hda, "-fw_cfg", qemu_fw_cfg])
self.emulator.login()
cmd = "modprobe efivarfs"