about summary refs log tree commit diff
path: root/nixos/lib
diff options
context:
space:
mode:
authorMax Hausch <max.hausch@helsinki-systems.de>2022-04-05 11:49:42 +0200
committerMax Hausch <max.hausch@helsinki-systems.de>2022-04-05 11:49:42 +0200
commita2465483e89026df3ea939f95f8cf8de6717ea9c (patch)
treecdce8c1b831f0ebd366431812818209670d0bad7 /nixos/lib
parent1a069f4e72b179f07cef6178f85dfc15eed5e321 (diff)
nixos/lib/qemu-common: Opportunistically use KVM
This will try to use KVM if available and fallback to using TCG if not.
Useful for nested virtualisation of arm on x86.
Diffstat (limited to 'nixos/lib')
-rw-r--r--nixos/lib/qemu-common.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/lib/qemu-common.nix b/nixos/lib/qemu-common.nix
index 20bbe9ff5d99f..250f714be0a7a 100644
--- a/nixos/lib/qemu-common.nix
+++ b/nixos/lib/qemu-common.nix
@@ -23,8 +23,8 @@ rec {
 
   qemuBinary = qemuPkg: {
     x86_64-linux = "${qemuPkg}/bin/qemu-kvm -cpu max";
-    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";
+    armv7l-linux = "${qemuPkg}/bin/qemu-system-arm -machine virt,accel=kvm:tcg -cpu max";
+    aarch64-linux = "${qemuPkg}/bin/qemu-system-aarch64 -machine virt,gic-version=max,accel=kvm:tcg -cpu max";
     powerpc64le-linux = "${qemuPkg}/bin/qemu-system-ppc64 -machine powernv";
     powerpc64-linux = "${qemuPkg}/bin/qemu-system-ppc64 -machine powernv";
     x86_64-darwin = "${qemuPkg}/bin/qemu-kvm -cpu max";