Linux Continues Crackdown On User-Space Poking CPU MSRs
The Linux kernel this year has seen new safeguards and efforts aiming to have user-space reduce their arbitrary poking of CPU machine specific registers (MSRs) in the name of security and other handling concerns. That effort has continued on with the Linux 5.11 cycle.
Linux user-space software with administrative privileges can write to arbitrary CPU MSRs and that can cause problems for a host of reasons. Recent kernels have added the support for adding notifications when an unrecognized MSR write from user-space occurs along with an option to allow filtering of MSR writes.
With Linux 5.11 the x86/misc code has the latest in "the ongoing fight against windmills in an attempt to have user-space tools not poke at naked MSRs."
The user-space tools like cpupower and turbostat that are hosted within the kernel tree have been adapted to no longer directly poke the x86 energy performance bias (EPB) MSR. In this case the Energy Performance Bias has already been exposed via sysfs and so they should have already been using it rather than needlessly dealing with the MSR directly. In turn, writes to MSR_IA32_ENERGY_PERF_BIAS are now blocked as user-space should be using the existing sysfs interface.
The MSR write filtering error messages printed to dmesg when such a write is attempted also now points users to this documentation.