Re: [PATCH v9 10/22] KVM: VMX: Add support for saving and restoring FRED MSRs
From: Chao Gao
Date: Wed Nov 12 2025 - 01:16:52 EST
>@@ -4316,6 +4374,12 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
> #endif
> case MSR_IA32_U_CET:
> case MSR_IA32_PL0_SSP ... MSR_IA32_PL3_SSP:
>+ if (!guest_cpu_cap_has(vcpu, X86_FEATURE_SHSTK)) {
>+ WARN_ON_ONCE(msr != MSR_IA32_FRED_SSP0);
This will be triggered if the guest only supports IBT and tries to write U_CET here.
>+ vcpu->arch.fred_ssp0_fallback = data;
>+ break;
>+ }
>+
> kvm_set_xstate_msr(vcpu, msr_info);
> break;
> default:
>@@ -4669,6 +4733,12 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
> #endif
> case MSR_IA32_U_CET:
> case MSR_IA32_PL0_SSP ... MSR_IA32_PL3_SSP:
>+ if (!guest_cpu_cap_has(vcpu, X86_FEATURE_SHSTK)) {
>+ WARN_ON_ONCE(msr_info->index != MSR_IA32_FRED_SSP0);
ditto.
With this fixed,
Reviewed-by: Chao Gao <chao.gao@xxxxxxxxx>