Re: [PATCH v10 09/28] KVM: VMX: Save/restore guest FRED RSP0

From: Binbin Wu

Date: Mon Sep 14 2026 - 03:19:25 EST


On 9/12/2026 5:36 AM, Sohil Mehta wrote:
> From: "Xin Li (Intel)" <xin@xxxxxxxxx>
>
> Save guest FRED RSP0 in vmx_prepare_switch_to_host() and restore it
> in vmx_prepare_switch_to_guest() because MSR_IA32_FRED_RSP0 is passed
> through to the guest, thus is volatile/unknown.
>
> Note, host FRED RSP0 is restored in arch_exit_to_user_mode_prepare(),
> regardless of whether it is modified in KVM.
>
> Signed-off-by: Xin Li (Intel) <xin@xxxxxxxxx>
> Signed-off-by: Sohil Mehta <sohil.mehta@xxxxxxxxx>
> Reviewed-by: Chao Gao <chao.gao@xxxxxxxxx>
> Reviewed-by: Binbin Wu <binbin.wu@xxxxxxxxxxxxxxx>
> ---
> v10:
> - No change
>
> Note, an equivalent TDX side implementation is missing. No TDX module
> with FRED support exists yet so this would be an issue for future
> platforms. A generic discussion regarding this is ongoing at:
> https://lore.kernel.org/kvm/20260827031837.2863609-1-binbin.wu@xxxxxxxxxxxxxxx/

For old KVM versions, we want to defer the opt-in design or backport decision.
(https://lore.kernel.org/kvm/c6b240bd-3c45-4abe-b17c-72a1a7da582f@xxxxxxxxxxxxxxx/)

We may finally choose to backport the TDX CPUID filtering patch series to stable
kernels. If this patch series lands first, should we add FRED in the deny list for
TDX as a temporary solution to avoid having some version(s) that allow FRED for
TDX without FRED support in KVM?