4 ms·
Generally no, the instructions that get access to many MSRs are privileged since they can affect the way things execute.
by simcop2387 8y ago
Generally no, the instructions that get access to many MSRs are privileged since they can affect the way things execute.
- ebikelaw 8y agoI understand they are privileged but the way Linux handles this feature seems acceptable.
- annerajb 8y agoWhy? MSR are not userspace registers. You don't want the userspace messing around with them either because they won't know 100% what they do. But more importantly for security.
- simcop2387 8y agoEven Linux requires this be done in kernel space, it's a requirement set by the architecture that the instructions that access them are run as part of the kernel. This is just like OSX, no different at all.
- ebikelaw 8y agoIn Linux root can open, read, and write /dev/msr.
- simcop2387 8y agoI haven't seen a /dev/msr before, but there is /dev/cpu/*/msr [1] provided by a kernel module. So there is a generic interface for them, but it's still all happening in kernel space. It's also not loaded by default either because it can cause system panics and corruption. [1] http://man7.org/linux/man-pages/man4/msr.4.html http://man7.org/linux/man-pages/man4/msr.4.html