From: Daan De Meyer Date: Wed, 16 Feb 2022 10:46:42 +0000 (+0000) Subject: Default to -cpu max when running VMs using QEMU X-Git-Tag: v13~11^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77f4487d301585229400be6de75da8f54b5ae9ab;p=thirdparty%2Fmkosi.git Default to -cpu max when running VMs using QEMU 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. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 062b74731..e48953db6 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -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