Skip to content

Commit 3f56d48

Browse files
mrc0mmandjohannbg
authored andcommitted
test: don't use -cpu max in GH Actions
There appears to be an issue with newer QEMU versions (spotted with Arch Linux and C9S containers) which causes the respective GH Action to hang when booting a QEMU VM in combination with the `-cpu max` parameter. During (a particularly painful) debugging session I once managed to get some output from such "frozen" machine (using `earlycon` and `earlyprintk` kernel cmdline options), and in that particular case the VM died with a trap caused by an invalid opcode. I couldn't reproduce this locally, only in GH Actions environment with Arch Linux and C9S containers. Also, so far I haven't found out which specific CPUID flag causes this, but using the `IvyBridge-v2` feature set seems to mitigate the issue.
1 parent 5c2f72f commit 3f56d48

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

test/run-qemu

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
# We prefer kvm, kqemu, userspace in that order.
44

55
export PATH=/usr/sbin:/usr/bin:/sbin:/bin
6+
QEMU_CPU="${QEMU_CPU:-max}"
67

7-
[[ -x /usr/bin/qemu ]] && BIN=/usr/bin/qemu && ARGS=(-cpu max)
8+
[[ -x /usr/bin/qemu ]] && BIN=/usr/bin/qemu && ARGS=(-cpu "$QEMU_CPU")
89
(lsmod | grep -q '^kqemu ') && BIN=/usr/bin/qemu && ARGS=(-kernel-kqemu -cpu host)
910
[[ -c /dev/kvm && -x /usr/bin/kvm ]] && BIN=/usr/bin/kvm && ARGS=(-cpu host)
1011
[[ -c /dev/kvm && -x /usr/bin/qemu-kvm ]] && BIN=/usr/bin/qemu-kvm && ARGS=(-cpu host)
1112
[[ -c /dev/kvm && -x /usr/libexec/qemu-kvm ]] && BIN=/usr/libexec/qemu-kvm && ARGS=(-cpu host)
12-
[[ -x /usr/bin/qemu-system-$(uname -m) ]] && BIN=/usr/bin/qemu-system-$(uname -m) && ARGS=(-cpu max)
13+
[[ -x /usr/bin/qemu-system-$(uname -m) ]] && BIN=/usr/bin/qemu-system-$(uname -m) && ARGS=(-cpu "$QEMU_CPU")
1314
[[ -c /dev/kvm && -x /usr/bin/qemu-system-$(uname -m) ]] && BIN=/usr/bin/qemu-system-$(uname -m) && ARGS=(-enable-kvm -cpu host)
1415

1516
[[ $BIN ]] || {

tools/test-github.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ else
4141
cd /lib/modules
4242
ls -1 | tail -1
4343
)" \
44+
QEMU_CPU="IvyBridge-v2" \
4445
DRACUT_NO_XATTR=1 \
4546
TEST_RUN_ID="$RUN_ID" \
4647
${TESTS:+TESTS="$TESTS"} \

0 commit comments

Comments
 (0)