go/src/runtime/os_linux_s390x.go
aimuz b7c20413c5 runtime: remove obsolete osArchInit function
The osArchInit function was introduced as a workaround for a Linux kernel bug
that corrupted vector registers on x86 CPUs during signal delivery.
The bug was introduced in Linux 5.2 and fixed in 5.3.15, 5.4.2, and all 5.5 and later kernels.
The fix was also back-ported by major distros.

Change-Id: I59990a7df104843955301c5cb8a547614eba145b
GitHub-Last-Rev: 8425af458b
GitHub-Pull-Request: golang/go#75246
Reviewed-on: https://go-review.googlesource.com/c/go/+/700555
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
2025-09-04 07:30:42 -07:00

29 lines
803 B
Go

// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package runtime
import "internal/cpu"
const (
_HWCAP_VX = 1 << 11 // vector facility
)
func archauxv(tag, val uintptr) {
switch tag {
case _AT_HWCAP:
cpu.HWCap = uint(val)
}
}
func checkS390xCPU() {
// Check if the present z-system has the hardware capability to carryout
// floating point operations. Check if hwcap reflects CPU capability for the
// necessary floating point hardware (HasVX) availability.
// Starting with Go1.19, z13 is the minimum machine level for running Go on LoZ
if cpu.HWCap&_HWCAP_VX == 0 {
print("runtime: This CPU has no floating point hardware, so this program cannot be run. \n")
exit(1)
}
}