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

From: Roman Storozhenko

Date: Wed Apr 01 2026 - 15:23:42 EST


On Mon, Mar 30, 2026 at 4:16 PM Borislav Petkov <bp@xxxxxxxxx> wrote:
>
> On Wed, Mar 25, 2026 at 06:48:52PM +0100, Roman Storozhenko wrote:
> > The term "unrecognized" in the warning message
> >
> > "Write to unrecognized MSR..."
> >
> > creates the impression that the MSR access is invalid or
> > prohibited, which is not necessarily the case.
> >
> > Remove this wording to avoid misleading users about the nature
> > of the access.
> >
> > Signed-off-by: Roman Storozhenko <romeusmeister@xxxxxxxxx>
> > ---
> > Additional context:
> >
> > A utility that uses direct MSR writes triggered this warning during
> > post-silicon validation. The message was interpreted as evidence of
> > incorrect or prohibited MSR access due to the use of the term
> > "unrecognized".
> >
> > This led to confusion among validation teams, although the MSR accesses
> > were intentional and valid.
> >
> > Clarify the message to avoid misleading users in similar scenarios.
> > ---
> > arch/x86/kernel/msr.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
> > index 4469c784eaa0..16f6cde7d471 100644
> > --- a/arch/x86/kernel/msr.c
> > +++ b/arch/x86/kernel/msr.c
> > @@ -98,7 +98,7 @@ static int filter_write(u32 reg)
> > if (!__ratelimit(&fw_rs))
> > return 0;
> >
> > - pr_warn("Write to unrecognized MSR 0x%x by %s (pid: %d), tainting CPU_OUT_OF_SPEC.\n",
> > + pr_warn("Write to MSR 0x%x by %s (pid: %d), tainting CPU_OUT_OF_SPEC.\n",
> > reg, current->comm, current->pid);
> > pr_warn("See https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/about for details.\n");
> >
> >
> > ---
>
> # modprobe msr allow_writes=on
> # grep -r . /sys/module/msr/parameters/allow_writes
> on

Hi Boris,

Thanks for the clarification.

If I understand correctly, in this context "unrecognized" does not refer
to the MSR itself being unknown, but rather reflects the driver policy
when writes are disabled (allow_writes=off).

In that case, the current wording can be misleading, as it suggests that
the MSR is invalid or unsupported, while in reality the write is simply
not permitted by policy.

Would it make sense to adjust the message to reflect this more explicitly,
for example:

"Write to MSR 0x%x (writes not enabled) by %s (pid: %d), tainting
CPU_OUT_OF_SPEC.\n"

This would preserve the warning while making the reason clearer.

Thanks,
Roman
>
> --
> Regards/Gruss,
> Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette



--
Kind regards,
Roman Storozhenko