9 Commits

Author SHA1 Message Date
Cherry Mui
4f4f1c6fea Revert "cpu: add HPDS, LOR, PAN detection for arm64"
This reverts CL 704075.

Reason for revert: Based on golang/go#76386, it doesn't seem to work correctly.

Fixes golang/go#76386.

Change-Id: I51ccbc8715c25c0d061d56dfbf0e8158f1207018
Reviewed-on: https://go-review.googlesource.com/c/sys/+/724160
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Cherry Mui <cherryyz@google.com>
2025-11-24 15:42:25 -08:00
Tobias Klauser
15129aafc3 cpu: also use MRS instruction in getmmfr1
Use the MRS instruction with the corresponding system register instead
of encoding the instructions using a WORD directive. This was missed in
CL 583135.

Change-Id: Ifcbbd81baa903f1da442eae2e49c06284db9c37d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/717681
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Florian Lehner <lehner.florian86@gmail.com>
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>
2025-11-04 13:29:36 -08:00
Tobias Klauser
3675c4cc48 cpu: use MRS instruction to read arm64 system registers
Use the MRS instruction with the corresponding system register instead
of encoding the instructions using a WORD directive.

Change-Id: I2995dfa6ad731cb03867160127db84898adfdda5
Reviewed-on: https://go-review.googlesource.com/c/sys/+/583135
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
2025-10-31 12:39:58 -07:00
Chongyi Zheng
6239615695 cpu: add HPDS, LOR, PAN detection for arm64
This CL gets ID_AA64MMFR1_EL1, Memory Model Feature Register 1, and
grabs HPDS, LOR, PAN features from its bits.

Fixes golang/go#75472.

Change-Id: Ic04b109d79aceba9b3b1d3a1ea514fcf132007c5
GitHub-Last-Rev: f938ff468b
GitHub-Pull-Request: golang/sys#263
Reviewed-on: https://go-review.googlesource.com/c/sys/+/704075
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
2025-10-28 09:43:50 -07:00
Michal Hruby
7758090324 cpu: add support for sve2 detection
Fixes golang/go#66952

Change-Id: Idaf2ce3b09baf33cf29079677a83a51ea9c4b255
GitHub-Last-Rev: eac00886d1
GitHub-Pull-Request: golang/sys#193
Reviewed-on: https://go-review.googlesource.com/c/sys/+/580655
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2024-05-03 16:45:19 +00:00
Dmitri Shuralyov
1bfbee0e20 all: update go directive to 1.18
Done with:

go get go@1.18
go mod tidy
go fix ./...

Using go1.21.3.

Also update code generators to use only the new go:build lines,
not the old +build ones.

For golang/go#60268.

Change-Id: I6aabc42efb6ab3329981100e1db2263aac5e92a6
Reviewed-on: https://go-review.googlesource.com/c/sys/+/534222
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-10-11 21:54:30 +00:00
Tobias Klauser
8feff5de77 cpu: add //go:build lines to assembly files
Change-Id: I44c0bab1cc8a3b7ce59a1c690cb22046bca32bac
Reviewed-on: https://go-review.googlesource.com/c/sys/+/313689
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
2021-04-26 21:46:56 +00:00
Tamir Duberstein
0a15ea8d9b *: use more precise build tags
s/!gccgo/gc/ in files which use gc-syntax assembly.

Change-Id: Iafc006cd60ad0e429cff182a05c790d80c380802
Reviewed-on: https://go-review.googlesource.com/c/sys/+/269717
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Than McIntosh <thanm@google.com>
2020-11-13 13:57:34 +00:00
Tobias Klauser
85b82a3add cpu: support reading arm64 CPU feature registers
This allows to detect ARM64 CPU features on non-Linux systems. On Linux,
this is used in case /proc/self/auxv cannot be read.

Change-Id: I67d55e989f2beda0c05a97ca5e55781840a8e01c
Reviewed-on: https://go-review.googlesource.com/c/sys/+/209478
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-12-04 07:21:56 +00:00