Skip to content

Commit 0a51aa0

Browse files
committed
tests: avoid crashing QEMU on ubuntu-24.04-arm
1 parent 17579b0 commit 0a51aa0

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

tests/test-vm.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,30 +75,30 @@ DPKG_ARCHITECTURE=$(dpkg --print-architecture)
7575
if [ "${DPKG_ARCHITECTURE}" = "amd64" ]; then
7676
qemu_command=( qemu-system-x86_64 )
7777
qemu_command+=( -machine q35 )
78+
qemu_command+=( -cpu max )
7879
elif [ "${DPKG_ARCHITECTURE}" = "arm64" ]; then
80+
# Pick a real CPU model, and also one that does not crash QEMU on ubuntu-24.04-arm.
81+
qemu_command=( qemu-system-aarch64 )
82+
qemu_command+=( -machine "type=virt,gic-version=max,accel=kvm:tcg" )
83+
qemu_command+=( -cpu cortex-a76 )
7984
if [ "$TARGET" = 'RPI' ]; then
8085
if ! rpi_bootdata="$(sudo "$TEST_PWD"/tests/extract-rpi-bootdata.sh "$VM_IMAGE")"; then
8186
echo "E: could not extract RPi boot data" >&2
8287
exit 1
8388
fi
8489
IFS='|' read rpi_kern rpi_initrd rpi_kerncmd <<< "$rpi_bootdata"
85-
qemu_command=( qemu-system-aarch64 )
86-
qemu_command+=( -machine "type=virt,gic-version=max,accel=kvm:tcg,highmem=off" )
8790
qemu_command+=( -kernel "$rpi_kern" )
8891
qemu_command+=( -initrd "$rpi_initrd" )
8992
qemu_command+=( -append "$rpi_kerncmd" )
9093
else
9194
cp /usr/share/AAVMF/AAVMF_VARS.fd efi_vars.fd
92-
qemu_command=( qemu-system-aarch64 )
93-
qemu_command+=( -machine "type=virt,gic-version=max,accel=kvm:tcg" )
9495
qemu_command+=( -drive "if=pflash,format=raw,unit=0,file.filename=/usr/share/AAVMF/AAVMF_CODE.no-secboot.fd,file.locking=off,readonly=on" )
9596
qemu_command+=( -drive "if=pflash,format=raw,unit=1,file=efi_vars.fd" )
9697
fi
9798
else
9899
echo "E: unsupported ${DPKG_ARCHITECTURE}" >&2
99100
exit 1
100101
fi
101-
qemu_command+=( -cpu max )
102102
qemu_command+=( -smp 2 )
103103
qemu_command+=( -m 2048 )
104104
qemu_command+=( -drive "file=${VM_IMAGE},format=raw,index=0,media=disk" )

0 commit comments

Comments
 (0)