sys/cpu
Vaughn Iverson 8f2aa9fb48 cpu: conditionally re-enable AVX512 support on darwin/amd64
Darwin opmask clobbering bug was fixed in kernel version 21.3.0
as released in MacOS 12.2.0. This commit resolves issue by
checking for Darwin AVX512 support via a sysctl call with the
addition of a kernel minimum version check.

The kernel version check is completed without adding new
dependencies to x/sys/cpu. A sysctl call is accomplished by
copying a minimal amount of code from x/sys/unix, to retrieve
only the needed KERN_OSRELEASE value. This code is structured
in the same manner as an existing analogous AIX/PPC64 syscall.

The resulting dotted version string value is then parsed for
numeric comparison with a dependency free function.

All code in this contribution is structured to ease removal of
the special darwin/amd64 codepaths when that OS/arch combination
is eventually no longer supported by golang.

Resolves issue: golang/go#49233, reinstates fix for issue: golang/go#43089

Change-Id: I4755fc8b3865eb6562b0959ecc910e2c46ac6cb4
Reviewed-on: https://go-review.googlesource.com/c/sys/+/620256
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: vsivsi@yahoo.com <vsivsi@yahoo.com>
2024-11-04 23:17:32 +00:00
..
asm_aix_ppc64.s all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
asm_darwin_x86_gc.s cpu: conditionally re-enable AVX512 support on darwin/amd64 2024-11-04 23:17:32 +00:00
byteorder.go
cpu.go cpu: add support for detecting RISC-V extensions 2024-08-23 10:43:34 +00:00
cpu_aix.go all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
cpu_arm.go
cpu_arm64.go cpu: add Int8 matrix multiplication instructions CPU feature flag for ARM64 2024-07-17 17:57:00 +00:00
cpu_arm64.s cpu: add support for sve2 detection 2024-05-03 16:45:19 +00:00
cpu_darwin_x86.go cpu: conditionally re-enable AVX512 support on darwin/amd64 2024-11-04 23:17:32 +00:00
cpu_gc_arm64.go cpu: add support for sve2 detection 2024-05-03 16:45:19 +00:00
cpu_gc_s390x.go all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
cpu_gc_x86.go cpu: conditionally re-enable AVX512 support on darwin/amd64 2024-11-04 23:17:32 +00:00
cpu_gc_x86.s cpu: conditionally re-enable AVX512 support on darwin/amd64 2024-11-04 23:17:32 +00:00
cpu_gccgo_arm64.go all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
cpu_gccgo_s390x.go all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
cpu_gccgo_x86.c all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
cpu_gccgo_x86.go cpu: conditionally re-enable AVX512 support on darwin/amd64 2024-11-04 23:17:32 +00:00
cpu_linux.go all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
cpu_linux_arm.go
cpu_linux_arm64.go all: execute gofmt 2024-10-11 18:38:43 +00:00
cpu_linux_mips64x.go all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
cpu_linux_noinit.go cpu: add support for detecting RISC-V extensions 2024-08-23 10:43:34 +00:00
cpu_linux_ppc64x.go all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
cpu_linux_riscv64.go cpu: add support for detecting RISC-V extensions 2024-08-23 10:43:34 +00:00
cpu_linux_s390x.go
cpu_loong64.go all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
cpu_mips64x.go all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
cpu_mipsx.go all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
cpu_netbsd_arm64.go
cpu_openbsd_arm64.go
cpu_openbsd_arm64.s
cpu_other_arm.go all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
cpu_other_arm64.go all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
cpu_other_mips64x.go all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
cpu_other_ppc64x.go all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
cpu_other_riscv64.go all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
cpu_other_x86.go cpu: conditionally re-enable AVX512 support on darwin/amd64 2024-11-04 23:17:32 +00:00
cpu_ppc64x.go all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
cpu_riscv64.go cpu: add support for detecting RISC-V extensions 2024-08-23 10:43:34 +00:00
cpu_s390x.go
cpu_s390x.s all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
cpu_s390x_test.go
cpu_test.go cpu: add support for detecting RISC-V extensions 2024-08-23 10:43:34 +00:00
cpu_wasm.go all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
cpu_x86.go cpu: conditionally re-enable AVX512 support on darwin/amd64 2024-11-04 23:17:32 +00:00
cpu_zos.go
cpu_zos_s390x.go
endian_big.go all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
endian_little.go all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
endian_test.go
hwcap_linux.go cpu: remove the use of ioutil 2023-09-14 15:30:27 +00:00
parse.go
parse_test.go
proc_cpuinfo_linux.go all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
runtime_auxv.go
runtime_auxv_go121.go all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
runtime_auxv_go121_test.go all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
syscall_aix_gccgo.go all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
syscall_aix_ppc64_gc.go all: update go directive to 1.18 2023-10-11 21:54:30 +00:00
syscall_darwin_x86_gc.go cpu: conditionally re-enable AVX512 support on darwin/amd64 2024-11-04 23:17:32 +00:00