cpu: don't read ARM64 registers on Android

It seems like on Android we're not allowed in all cases to read the
registers ISAR0, ISAR1 and PFR0 to detect CPU features.

Fixes golang/go#36622

Change-Id: I577bd928a5a4dcd6e908cf059faa15fc0c80e3e5
Reviewed-on: https://go-review.googlesource.com/c/sys/+/215237
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/cpu/cpu_arm64.go b/cpu/cpu_arm64.go
index 6ac0b35..9c87677 100644
--- a/cpu/cpu_arm64.go
+++ b/cpu/cpu_arm64.go
@@ -10,9 +10,13 @@
 
 func init() {
 	switch runtime.GOOS {
-	case "darwin":
-		// iOS does not seem to allow reading these registers
-	case "android", "linux":
+	case "android", "darwin":
+		// Android and iOS don't seem to allow reading these registers.
+		// Fake the minimal features expected by
+		// TestARM64minimalFeatures.
+		ARM64.HasASIMD = true
+		ARM64.HasFP = true
+	case "linux":
 		doinit()
 	default:
 		readARM64Registers()