]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Default to -cpu max when running VMs using QEMU
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 16 Feb 2022 10:46:42 +0000 (10:46 +0000)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 20 Jun 2022 11:25:03 +0000 (13:25 +0200)
Currently, we don't specify the -cpu option when running under the TCG
accelerator. This leads QEMU to choose a very conservative default that
doesn't emulate all the instructions that modern distros are compiled with.
To avoid such issues, let's default to having QEMU emulate as many CPU
instructions as possible to avoid illegal opcode errors when running
virtual machines.

mkosi/__init__.py

index 062b747311c24dd0e52f68bddc0a8df0d41f53f3..e48953db65bb899e04bdb7a19149904adcb0161c 100644 (file)
@@ -7951,8 +7951,7 @@ def run_qemu_cmdline(args: MkosiArgs) -> Iterator[List[str]]:
         "virtio-rng-pci,rng=rng0,id=rng-device0",
     ]
 
-    if args.qemu_kvm:
-        cmdline += ["-cpu", "host"]
+    cmdline += ["-cpu", "max"]
 
     if args.qemu_headless:
         # -nodefaults removes the default CDROM device which avoids an error message during boot