Skip to content

Commit

Permalink
cpu: add support for DIT detection
Browse files Browse the repository at this point in the history
Change-Id: I9f0991da9684ebd297e40a754e34130c418c34d0
Reviewed-on: https://go-review.googlesource.com/c/sys/+/597377
Reviewed-by: Ian Lance Taylor <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
  • Loading branch information
rolandshoemaker committed Jul 11, 2024
1 parent 4cafe5c commit 47fe916
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions cpu/cpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ var ARM64 struct {
HasSVE bool // Scalable Vector Extensions
HasSVE2 bool // Scalable Vector Extensions 2
HasASIMDFHM bool // Advanced SIMD multiplication FP16 to FP32
HasDIT bool // Data Independent Timing support
_ CacheLinePad
}

Expand Down
5 changes: 5 additions & 0 deletions cpu/cpu_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ func parseARM64SystemRegisters(isar0, isar1, pfr0 uint64) {

parseARM64SVERegister(getzfr0())
}

switch extractBits(pfr0, 48, 51) {
case 1:
ARM64.HasDIT = true
}
}

func parseARM64SVERegister(zfr0 uint64) {
Expand Down

0 comments on commit 47fe916

Please sign in to comment.