From 7d39db56757bb7e39dadbf6ac5f58d9b037205a8 Mon Sep 17 00:00:00 2001 From: Alexander Potapenko Date: Mon, 21 Oct 2024 17:12:01 +0200 Subject: pkg/mgrconfig: increase the timeouts if running on QEMU with TCG Previously we were assuming that QEMU with matching host/guest architectures was using -enable-kvm, but for arm64 that's not always the case. --- pkg/mgrconfig/load.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pkg/mgrconfig') diff --git a/pkg/mgrconfig/load.go b/pkg/mgrconfig/load.go index b5e171973..792802e60 100644 --- a/pkg/mgrconfig/load.go +++ b/pkg/mgrconfig/load.go @@ -4,6 +4,7 @@ package mgrconfig import ( + "bytes" "fmt" "os" "path/filepath" @@ -237,6 +238,11 @@ func (cfg *Config) completeServices() error { func (cfg *Config) initTimeouts() { slowdown := 1 switch { + case cfg.Type == "qemu" && (runtime.GOARCH == cfg.SysTarget.Arch || runtime.GOARCH == cfg.SysTarget.VMArch): + // If TCG is enabled for QEMU, increase the slowdown. + if bytes.Contains(cfg.VM, []byte("-accel tcg")) { + slowdown = 10 + } case cfg.Type == "qemu" && runtime.GOARCH != cfg.SysTarget.Arch && runtime.GOARCH != cfg.SysTarget.VMArch: // Assuming qemu emulation. // Quick tests of mmap syscall on arm64 show ~9x slowdown. -- cgit mrf-deployment