diff mbox series

[4/4] test-runner: Use host CPU when starting VM

Message ID 20250212135209.129361-4-arkadiusz.bokowy@gmail.com (mailing list archive)
State Accepted
Commit 4577f50e739fc92dd633e8ac6426144a77844fba
Headers show
Series [1/4] test-runner: Increase amount of RAM available in VM | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success

Commit Message

Arkadiusz Bokowy Feb. 12, 2025, 1:52 p.m. UTC
When running test-runner on Ubuntu 24.04 with mainline kernel compiled
from Ubuntu default configuration with applied tester.config options,
the QEMU is not able to start the test-runner application due to illegal
instruction. Passing '-cpu host' fixes that issue.

> $ tools/test-runner -k linux/arch/x86/boot/bzImage -- tools/mgmt-tester
> Using QEMU binary /usr/bin/qemu-system-x86_64
> Using kernel image [...]/linux/arch/x86/boot/bzImage
> Found support for Virtual Machine eXtensions
> [...]
> [    0.000000] Linux version 6.14.0-rc2+ (gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0 [...]
> [...]
> Running command tools/mgmt-tester
> New process 74 created
> Illegal instruction
> Process 74 exited with status 132
> [    0.881239] reboot: Restarting system
> [    0.881431] reboot: machine restart

Potential caveat:

In case when the KVM is not available on the host, the QEMU will not
start with the warning:
CPU model 'host' requires KVM or HVF
---
 tools/test-runner.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/tools/test-runner.c b/tools/test-runner.c
index 1fc95d33f..48e114174 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -211,6 +211,7 @@  static char *const qemu_argv[] = {
 	"-monitor", "none",
 	"-display", "none",
 	"-machine", "type=q35,accel=kvm:tcg",
+	"-cpu", "host",
 	"-m", "256M",
 	"-net", "none",
 	"-no-reboot",