Re: [PATCH] x86/msr: Remove misleading "unrecognized" wording in write warning
From: Roman Storozhenko
Date: Thu Apr 02 2026 - 13:37:43 EST
On Wed, Apr 1, 2026 at 9:27 PM Borislav Petkov <bp@xxxxxxxxx> wrote:
>
> On Wed, Apr 01, 2026 at 09:18:57PM +0200, Roman Storozhenko wrote:
> > Would it make sense to adjust the message to reflect this more explicitly,
> > for example:
>
> Only after you answer my question why you cannot use the module parameter
> allow_writes?
>
> That's *exactly* why we added it at the time - exactly for such cases.
>
> :-)
I can use 'allow_writes', but userland SW uses "/dev/cpu/<X>/msr"
relies on default
msr driver behaviour. Indeed, it would be strange if such SW reloads a
kernel driver (if it is possible) to make
sure that this message doesn't appear. Most distributions don't pass
that parameter.
Let's take a SW I work on as an example:
https://github.com/intel/intel-cmt-cat
If your CPU supports Intel RDT you could build and run it:
hedin@laptop:~/prj/intel-cmt-cat$ make -j`nproc`
hedin@laptop:~/prj/intel-cmt-cat$ sudo LD_LIBRARY_PATH=lib pqos/pqos
--iface=msr -m all:0-7
to see that 'unrecognized' messages in dmesg periodically.
Of course 'allows_writes' isn't provided in this case (Ubuntu distro):
hedin@laptop:~/prj/intel-cmt-cat$ sudo grep -r .
/sys/module/msr/parameters/allow_writes
default
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
Our stakeholders interpret that 'unrecognized' word as a writing to
wrong or non-existing MSR registers.
To be honest I interpreted this in this way too, unless I read msr driver code.
That is why I posted this patch. My intention is to align this message
with what is really happening in the
driver, that is writing to a valid register, but against the current policy.
>
> --
> Regards/Gruss,
> Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette
--
Kind regards,
Roman Storozhenko