On Tue, Sep 06, 2011 at 02:47:48PM +0100, David Gilbert wrote:
On 6 September 2011 14:38, Mans Rullgard mans.rullgard@linaro.org wrote:
I have an old kernel patch somewhere that allows userspace to read the ID register by emulating the relevant MRC in the illegal instruction trap handler. Perhaps this is something worth reviving. With this approach, interpreting the ID value would still be left as an exercise for the application.
Would it be better for the kernel just to pass it in the AUXV somewhere?
This could be done, but it feels like an abuse somehow. An independent aux vector is passed to each process, so it makes most sense for process-specific information.
Although auxv is convenient, I'd say that global, nonmodifiable properties of the system should really be exported by some different, global mechanism. It's questionable whether the hwcaps really belong in auxv at all -- it's possible that some platforms make use of this and actually report different hwcaps to different processes, but AFAIK we don't do this on ARM. Now that hwcaps is there, it should stay there, for historical reasons and consistency with other architectures.
sysfs feels like the least worst solution for exporting additional information.
---Dave