Re: [PATCH v10 10/28] KVM: VMX: Add support for saving and restoring FRED MSRs
From: Binbin Wu
Date: Fri Oct 23 2026 - 04:59:59 EST
On 9/12/2026 5:36 AM, Sohil Mehta wrote:
> From: "Xin Li (Intel)" <xin@xxxxxxxxx>
>
> Introduce support for handling FRED MSR access requests, enabling both
> host and guest to read and write FRED MSRs, which is essential for VM
> save/restore and live migration, and allows userspace tools such as QEMU
> to access the relevant MSRs.
>
> Specially, intercept accesses to the FRED SSP0 MSR (IA32_PL0_SSP), which
> remains accessible when FRED is enumerated even if CET is not.
Nit:
It sounds like the patch adds interception. But the patch emulates the access
of the MSR.
> This
> ensures the guest value is fully virtual and does not alter the hardware
> FRED SSP0 MSR.
>
> Signed-off-by: Xin Li (Intel) <xin@xxxxxxxxx>
> Signed-off-by: Sohil Mehta <sohil.mehta@xxxxxxxxx>
> Reviewed-by: Chao Gao <chao.gao@xxxxxxxxx>
> ---
> v10:
> - Fix a corner case identified by Chao Gao.
> ---
> arch/x86/include/asm/kvm_host.h | 5 ++
> arch/x86/include/asm/msr-index.h | 2 +
> arch/x86/kvm/msrs.c | 89 ++++++++++++++++++++++++++++++--
> arch/x86/kvm/vmx/vmx.c | 45 ++++++++++++++++
> 4 files changed, 138 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
> index 8d3999772ac2..0fd5d4edeebb 100644
> --- a/arch/x86/include/asm/kvm_host.h
> +++ b/arch/x86/include/asm/kvm_host.h
> @@ -1032,6 +1032,11 @@ struct kvm_vcpu_arch {
> #if IS_ENABLED(CONFIG_HYPERV)
> hpa_t hv_root_tdp;
> #endif
> + /*
> + * Stores the FRED SSP0 MSR when CET is not supported, prompting KVM
Nit:
CET could be more specific, i.e. SHSTK. I am not sure if there is a situation
that one is supported, but the other is not.
"prompting KVM to intercept its accesses" is confusing to me.
> + * to intercept its accesses.
> + */
> + u64 fred_ssp0_fallback;
> };
[...]