5 ms·
Firstly, the Linux kernel already provides easy accessors for the MSRs, see arch/x86/include/asm/msr.h. Secondly, have you investigated the existing msr-tools
by neoteric 13y ago
Firstly, the Linux kernel already provides easy accessors for the MSRs, see arch/x86/include/asm/msr.h. Secondly, have you investigated the existing msr-tools package, and the existing driver for msr accesses? (see /dev/cpu/<n>/msr in usermode and arch/x86/kernel/msr.c providing the functionality).
- nkurz 13y agoYes, I've looked at those, and presume the original author has too. You are definitely right that most users will find the built in functionality a better choice. My current interest is currently on how to allow low overhead self-profiling of user code without root access. I found this code to be a good introduction to what's happening under the hood, and possibly a good base for creating a PMU specific module to extend access to non-root non-SYS_CAP_RAWIO users. It sounds like you have some familiarity with this. If you have thoughts, I'd love to hear on the Likwid developers list: https://groups.google.com/forum/#!forum/likwid-developers https://groups.google.com/forum/#!forum/likwid-developers