From 82e4216b58d2981ae45ca978cdab11697b615f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Fri, 27 Dec 2024 16:22:27 +0100 Subject: [PATCH] Disable AVX-512 support for macOS Intel host MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Handling AVX-512 instructions requires promoting threads in the operating system, but it is not required by distros. So make do with the earlier microarchitectures (v2 and v3), without exposing all the host features of the newest (v4). Signed-off-by: Anders F Björklund --- pkg/qemu/qemu.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/qemu/qemu.go b/pkg/qemu/qemu.go index 9bd5a8c521b..6756b155773 100644 --- a/pkg/qemu/qemu.go +++ b/pkg/qemu/qemu.go @@ -534,6 +534,9 @@ func Cmdline(ctx context.Context, cfg Config) (exe string, args []string, err er if !strings.Contains(cpu, ",-pdpe1gb") { logrus.Warnf("On Intel Mac, CPU type %q typically needs \",-pdpe1gb\" option (https://stackoverflow.com/a/72863744/5167443)", cpu) } + // disable AVX-512, since it requires trapping instruction faults in guest + // Enterprise Linux requires either v2 (SSE4) or v3 (AVX2), but not yet v4. + cpu += ",-avx512vl" } } if !strings.Contains(string(features.CPUHelp), strings.Split(cpu, ",")[0]) {