From 2bd296a7e9551fcc74330460d6bf47810a8f9555 Mon Sep 17 00:00:00 2001 From: volth Date: Thu, 18 Apr 2019 19:35:51 +0000 Subject: [PATCH] runInLinuxVM, test-driver: pass host's cpu type to guest vm 'kvm64' is the most generic CPU, which does not support SSE4.2, AVX and other ISA extentions. --- nixos/lib/qemu-flags.nix | 4 ++-- nixos/tests/installer.nix | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nixos/lib/qemu-flags.nix b/nixos/lib/qemu-flags.nix index 774f66b4804e..859d9e975fec 100644 --- a/nixos/lib/qemu-flags.nix +++ b/nixos/lib/qemu-flags.nix @@ -17,9 +17,9 @@ in else throw "Unknown QEMU serial device for system '${pkgs.stdenv.hostPlatform.system}'"; qemuBinary = qemuPkg: { - x86_64-linux = "${qemuPkg}/bin/qemu-kvm -cpu kvm64"; + x86_64-linux = "${qemuPkg}/bin/qemu-kvm -cpu host"; armv7l-linux = "${qemuPkg}/bin/qemu-system-arm -enable-kvm -machine virt -cpu host"; aarch64-linux = "${qemuPkg}/bin/qemu-system-aarch64 -enable-kvm -machine virt,gic-version=host -cpu host"; - x86_64-darwin = "${qemuPkg}/bin/qemu-kvm -cpu kvm64"; + x86_64-darwin = "${qemuPkg}/bin/qemu-kvm -cpu host"; }.${pkgs.stdenv.hostPlatform.system} or "${qemuPkg}/bin/qemu-kvm"; } diff --git a/nixos/tests/installer.nix b/nixos/tests/installer.nix index eb1f4f192dd1..024445b01b6c 100644 --- a/nixos/tests/installer.nix +++ b/nixos/tests/installer.nix @@ -74,7 +74,7 @@ let # FIXME don't duplicate the -enable-kvm etc. flags here yet again! qemuFlags = (if system == "x86_64-linux" then "-m 768 " else "-m 512 ") + - (optionalString (system == "x86_64-linux") "-cpu kvm64 ") + + (optionalString (system == "x86_64-linux") "-cpu host ") + (optionalString (system == "aarch64-linux") "-enable-kvm -machine virt,gic-version=host -cpu host "); hdFlags = ''hda => "vm-state-machine/machine.qcow2", hdaInterface => "${iface}", ''