Hello community,
I am curious why there isn’t a common way to dynamically query available extensions at runtime?
Ideally, it would be helpful to have a dedicated register to hold this information. A user ( OS kernel, hypervisor, etc ) could then simply read this register to determine which extensions are supported. However, this approach requires hardware updates and is not feasible for existing hardware already on the market.
A more practical solution seems to be an OpenSBI call that either:
Implementing this functionality in OpenSBI could benefit the Linux kernel and other software that require runtime detection of supported extensions. This would eliminate the need to replicate the mechanisms currently implemented in the Linux kernel, as seen here:
Linux Kernel CPU Feature Detection Code.
Does it make sense to implement something similar to what Linux already has in OpenSBI, or would OpenSBI benefit from providing an alternative approach for detecting available extensions? Does it make sense to have such SBI calls at all?
Thanks in advance.
Best regards,
Oleksii