Re: [PATCH] x86/msr: Remove misleading "unrecognized" wording in write warning

From: Borislav Petkov

Date: Thu Apr 02 2026 - 14:11:38 EST


On Thu, Apr 02, 2026 at 07:37:14PM +0200, Roman Storozhenko wrote:
> Both allocation and monitoring use 'msr_write' and 'msr_read'
> functions that rely on '/dev/cpu/<X>/msr:
> https://github.com/intel/intel-cmt-cat/blob/master/lib/allocation.c
> https://github.com/intel/intel-cmt-cat/blob/master/lib/common_monitoring.c
> https://github.com/intel/intel-cmt-cat/blob/master/lib/machine.c

This is exactly the problem: Those MSRs belong to the kernel. So if some
userspace tool goes and pokes at them under the kernel's feet, then you get to
keep both pieces.

This is exactly why MSR accesses are filtered. You can read this commit
message carefully:

a7e1f67ed29f ("x86/msr: Filter MSR writes")

Your tool should work *with* the kernel which should arbitrate accesses and
even better - there should be proper interfaces to the hw facilities you need
- but no tool should poke at MSRs without synchronization and arbitration with
the kernel.

So you should remove *all* msr_*() function calls in your tool and propose
proper interfaces. That's the only viable way forward.

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette