@samitouri / QOSamiQemu / commits / 4605092d2a

tests/functional/aarch64: Add basic test of TCG aarch64=off

Add a basic test of the TCG 'aarch64=off' functionality; this is the same as our existing arm/test_virt test, but it runs the AArch32 guest kernel on qemu-system-aarch64 with -cpu max,aarch64=off. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20260416165353.589569-4-peter.maydell@linaro.org

Peter Maydell committed Apr 16, 2026 at 17:53 UTC 4605092d2a1967809030832e47e49a0fdd852a8a
2 files changed +38
tests/functional/aarch64/meson.build
+1
@@ -47,6 +47,7 @@ tests_aarch64_system_thorough = [
47 'tcg_plugins',
48 'tuxrun',
49 'virt',
50 + 'virt_aarch64_off',
51 'virt_gpu',
52 'virt_vbsa',
53 'xen',
tests/functional/aarch64/test_virt_aarch64_off.py new
+37
@@ -0,0 +1,37 @@
1 +#!/usr/bin/env python3
2 +#
3 +# Functional test that boots an AArch32 Linux kernel and checks the console
4 +# on a TCG aarch64 CPU with aarch64=off. This is the same image etc
5 +# as we use in tests/functional/arm/test_virt.py.
6 +#
7 +# SPDX-License-Identifier: GPL-2.0-or-later
8 +
9 +from qemu_test import LinuxKernelTest, Asset
10 +
11 +class ArmVirtMachine(LinuxKernelTest):
12 +
13 + ASSET_KERNEL = Asset(
14 + ('https://archives.fedoraproject.org/pub/archive/fedora/linux/'
15 + 'releases/29/Everything/armhfp/os/images/pxeboot/vmlinuz'),
16 + '18dd5f1a9a28bd539f9d047f7c0677211bae528e8712b40ca5a229a4ad8e2591')
17 +
18 + def test_arm_virt(self):
19 + self.set_machine('virt')
20 + # KVM aarch64=off requires a host CPU that supports it, so
21 + # restrict the test to TCG only
22 + self.require_accelerator('tcg')
23 + self.vm.add_args('-cpu', 'max,aarch64=off')
24 +
25 + kernel_path = self.ASSET_KERNEL.fetch()
26 +
27 + self.vm.set_console()
28 + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
29 + 'console=ttyAMA0')
30 + self.vm.add_args('-kernel', kernel_path,
31 + '-append', kernel_command_line)
32 + self.vm.launch()
33 + console_pattern = 'Kernel command line: %s' % kernel_command_line
34 + self.wait_for_console_pattern(console_pattern)
35 +
36 +if __name__ == '__main__':
37 + LinuxKernelTest.main()