-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cpuinfo: Check for extensions using riscv_hwprobe #18
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly minor stylistic comments, but nice changes overall. I really like getting nix specific headers out of the cpuinfo header, so projects don't implicitly have those dumped in for feature testing
All done! |
I should mention that this syscall exists from Linux 6.4 onwards, maybe it should fallback to the old implementation if the syscall fails Edit: Made it fallback to the old implementation if the syscall returns error due to not existing |
Update Cpuinfo to use the linux syscall riscv_hwprobe to check for extensions instead of the auxiliary vector value.
Each case is written out explicitly because in the future more extensions might be added and the syscall may include more bitfields when the current one (RISCV_HWPROBE_KEY_IMA_EXT_0) runs out of bits.
https://github.com/torvalds/linux/blob/master/arch/riscv/include/uapi/asm/hwprobe.h