Closed klauspost closed 3 years ago
So it is clear that reading the registers is privileged. Since switching out of user mode is a non-starter, I am afraid we are stuck.
We can say that we support freebsd from 12.0 onwards, or we have to revert the functionality.
@fwessels You can take a look at the Go implementation which uses a different approach.
Has this been fixed? I see some ARM-related commits (and even a linked merged PR) but am not sure if I should update Caddy to the latest tag of this lib or not. Right now we've downgraded to v1.2.5.
Will be fixed by https://github.com/klauspost/cpuid/pull/62
On arm64/darwin, features can be detected using special sysctl keys. Unfortunately I do not have a machine to test that though.
@fwessels
Looks like the only safe option is to use an OS call to get these features.
Maybe the Go runtime can provide some help?
https://github.com/golang/go/tree/master/src/internal/cpu
And some in the runtime:
https://github.com/golang/go/blob/8174f7fb2b64c221f7f80c9f7fd4d7eb317ac8bb/src/runtime/os_linux_arm64.go#L11
... though I haven't found where archauxv is actually called from.