Re: [PATCH v2] x86/fred: Consolidate the FRED stack pointer assignments

From: Dave Hansen

Date: Mon Nov 30 2026 - 18:38:18 EST


On 11/30/26 15:18, H. Peter Anvin wrote:
>> BTW, does the KVM code need the MSR value or does it also need to do a
>> wrmsr()?
> It *is* doing a wrmsr? The point is that it doesn't need to do a rdmsr.

I was just thinking that the redundancy in the use could be removed by
moving the wrmsr() into the helper. Instead of:

wrmsrq(MSR_IA32_FRED_RSP1, this_cpu_fred_sp(MSR_IA32_FRED_RSP1));

it might make sense for it to look more like:

build_fred_sp(MSR_IA32_FRED_RSP1);

and then do the wrmsr() internally. It might be a bit more compact.