]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Use host model cpu
authorMatteo Croce <teknoraver@meta.com>
Thu, 12 Dec 2024 16:47:44 +0000 (17:47 +0100)
committerJörg Behrmann <behrmann@physik.fu-berlin.de>
Thu, 12 Dec 2024 19:29:44 +0000 (20:29 +0100)
mkosi currently calls qemu with `-cpu max`. This enables all features
supported by the accelerator, which could be less than the ones
supported by the host.

Switch to the default `-cpu host` and keep max only when using binary
translation.

mkosi/qemu.py

index 4b5889a1a7308071219af24171fe57fad9b5503e..aef7310997eee1815bd17124e527e38b11d62b2e 100644 (file)
@@ -1093,6 +1093,7 @@ def run_qemu(args: Args, config: Config) -> None:
             accel += ",device=/dev/fdset/1"
     else:
         accel = "tcg"
+        cmdline += ["-cpu", "max"]
 
     cmdline += ["-accel", accel]
 
@@ -1115,8 +1116,6 @@ def run_qemu(args: Args, config: Config) -> None:
         index = list(qemu_device_fds.keys()).index(QemuDeviceNode.vhost_vsock)
         cmdline += ["-device", f"vhost-vsock-pci,guest-cid={cid},vhostfd={SD_LISTEN_FDS_START + index}"]
 
-    cmdline += ["-cpu", "max"]
-
     if config.qemu_gui:
         if config.architecture.is_arm_variant():
             cmdline += ["-device", "virtio-gpu-pci"]