Revert "runtime: Check LSE support on ARM64 at runtime init"

This reverts CL 610195.

Reason for revert: SIGILL on macOS. See issue #71411.

Updates #69124, #60905.
Fixes #71411.

Change-Id: Ie0624e516dfb32fb13563327bcd7f557e5cba940
Reviewed-on: https://go-review.googlesource.com/c/go/+/644695
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
This commit is contained in:
Cherry Mui 2025-01-27 09:11:36 -08:00
parent e2e700f8b1
commit 475e08349d

View file

@ -8,11 +8,6 @@
#include "funcdata.h" #include "funcdata.h"
#include "textflag.h" #include "textflag.h"
#ifdef GOARM64_LSE
DATA no_lse_msg<>+0x00(SB)/64, $"This program can only run on ARM64 processors with LSE support.\n"
GLOBL no_lse_msg<>(SB), RODATA, $64
#endif
TEXT runtime·rt0_go(SB),NOSPLIT|TOPFRAME,$0 TEXT runtime·rt0_go(SB),NOSPLIT|TOPFRAME,$0
// SP = stack; R0 = argc; R1 = argv // SP = stack; R0 = argc; R1 = argv
@ -82,21 +77,6 @@ nocgo:
BL runtime·wintls(SB) BL runtime·wintls(SB)
#endif #endif
// Check that CPU we use for execution supports instructions targeted during compile-time.
#ifdef GOARM64_LSE
#ifndef GOOS_openbsd
// Read the ID_AA64ISAR0_EL1 register
MRS ID_AA64ISAR0_EL1, R0
// Extract the LSE field (bits [23:20])
LSR $20, R0, R0
AND $0xf, R0, R0
// LSE support is indicated by a non-zero value
CBZ R0, no_lse
#endif
#endif
MOVW 8(RSP), R0 // copy argc MOVW 8(RSP), R0 // copy argc
MOVW R0, -8(RSP) MOVW R0, -8(RSP)
MOVD 16(RSP), R0 // copy argv MOVD 16(RSP), R0 // copy argv
@ -115,23 +95,6 @@ nocgo:
// start this M // start this M
BL runtime·mstart(SB) BL runtime·mstart(SB)
RET
#ifdef GOARM64_LSE
#ifndef GOOS_openbsd
no_lse:
MOVD $1, R0 // stderr
MOVD R0, 8(RSP)
MOVD $no_lse_msg<>(SB), R1 // message address
MOVD R1, 16(RSP)
MOVD $64, R2 // message length
MOVD R2, 24(RSP)
CALL runtime·write(SB)
CALL runtime·exit(SB)
CALL runtime·abort(SB)
RET
#endif
#endif
// Prevent dead-code elimination of debugCallV2 and debugPinnerV1, which are // Prevent dead-code elimination of debugCallV2 and debugPinnerV1, which are
// intended to be called by debuggers. // intended to be called by debuggers.