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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 --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",
-- 
2.43.0





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux