Re: [PATCH v2] x86/fred: Consolidate the FRED stack pointer assignments
From: Sohil Mehta
Date: Mon Nov 30 2026 - 19:03:07 EST
On 11/30/2026 3:48 PM, Dave Hansen wrote:
> On 11/30/26 15:43, Sohil Mehta wrote:
>> KVM doesn't write to the same MSR as the kernel. KVM reads the value and
>> writes to the VMCS field HOST_IA32_FRED_RSP1.
>
> This is all optimization, right? How about the series just does rdmsr()
> for now. It's the smallest amount of code. Start there. Optimize later.
Yes, we could do the optimization later.
Sean's request originated here:
https://lore.kernel.org/all/aahchI7oiFrjFAmb@xxxxxxxxxx/
"The simplest approach would be to read the actual MSR. _If_ using a
per-CPU read provides meaningful performance benefits over RDMSR, ...
then have the kernel provide a dedicated accessor."
So, I am assuming he is still okay with deferring the optimization.
FWIW, I measured the cycle difference between the per-CPU read and the
MSR read. It was ~6x more with the MSR read but with all the things
happening during vCPU load 3 MSR reads shouldn't matter much.