Re: [PATCH v1 2/4] x86/fred: Write to FRED MSRs with wrmsrns()

Borislav Petkov
2024-07-03T16:17:23Z

On Wed, Jul 03, 2024 at 09:06:55AM -0700, H. Peter Anvin wrote:
> I believe tglx declared to use them unconditionally since FRED depends on
> WRMSRNS (and the kernel enforces that.)
>
> Using an alternative would make wrmsrns() a more useful construct in
> general, though.

We can't use them unconditionally and we don't need an alternative just for
that - a simple

if (cpu_feature_enabled(X86_FEATURE_WRMSRNS))
wrmsrns()
else
wrmsr()

would be perfectly fine.

--
Regards/Gruss,
Boris.