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

From: Dave Hansen
Date: Wed Jul 03 2024 - 12:43:14 EST


On 7/3/24 09:06, H. Peter Anvin wrote:
> I believe tglx declared to use them unconditionally since FRED> depends on WRMSRNS (and the kernel enforces that.)

Ahh, I forgot about:

static const struct cpuid_dep cpuid_deps[] = {
...
{ X86_FEATURE_FRED, X86_FEATURE_WRMSRNS },

So, yeah, Xin's patch here is quite safe and when Boris said:

> Also, all those wrmsrns() writes better be behind a CPUID check.

... it *is* behind a CPUID check, but it's an implicit one.