News for hackers. Stuff that matters.
Re:A Linux Kernel Module For Reading/Writing MSRs by nkurz on Wednesday November 20, 2013 @06:57PM (#6772168)
While this can be done for the uncore PCI counters, I don't think there is any reasonable way to do this for the MSRs. And you'd still be relying on the kernel to service your request since 'wrmsr' and 'rdmsr' can only be executed from Ring 0 (kernel mode).

But if your goal is to reduce overhead, you can read the performance counters with 'rdpmc', which can be configured to be usable from Ring 3 (user level). This is a route that I'm currently pursuing. More details in some of the messages here: https://groups.google.com/forum/#!forum/likwid-developers

This link about mapping PCI configuration space to be accessible to non-root users might be useful too: http://www.cs.usfca.edu/~cruse/cs698f11/uhci.c

There are no comments on this comment yet.