Re: [PATCH v10 00/28] KVM: Enable FRED support with KVM VMX

From: Sohil Mehta

Date: Tue Oct 27 2026 - 13:44:41 EST



> From: Sean Christopherson <seanjc@xxxxxxxxxx>
> Date: Mon, 26 Oct 2026 07:37:03 -0700
> Subject: [PATCH] KVM: x86: Don't bother loading host values for SYSCALL MSRs
> when FRED is in use
>
> Elide the WRMSRs for the SYSCALL MSRs when returning to userspace if FRED
> is in use, in which case said MSRs are never actually used in Linux.
>
> Note, KVM never saves/restores MSR_CSTAR via the user-return MSR mechanism,
> as the MSR is unused by Intel/VMX hardware, and SVM unconditionally context
> switches the MSR via a dedicated VMCB field (along with all other SYSCALL
> MSRs). Include MSR_CSTAR to provide a contiguous range of values in the
> case statements, e.g. so that the compiler can optimize the case statements
> into a simple bounds checks.
>

Sean, I assume you will post this separately. I don't think it depends
on anything in this series. Please let me know if you want me to do
anything additional here.

> Suggested-by: Xin Li (Intel) <xin@xxxxxxxxx>

BTW, Xin no longer works at Intel. For any of his *new* contributions to
the kernel, he has been using:

Xin Li <xin@xxxxxxxxx>


> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
> ---
> arch/x86/kvm/msrs.c | 20 +++++++++++++++++++-
> 1 file changed, 19 insertions(+), 1 deletion(-)
>
>