Re: [PATCH v4 02/19] KVM: VMX: Initialize VM entry/exit FRED controls in vmcs_config
From: Chao Gao
Date: Mon Apr 14 2025 - 03:43:45 EST
>diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
>index f1348b140e7c..e38545d0dd17 100644
>--- a/arch/x86/kvm/vmx/vmx.c
>+++ b/arch/x86/kvm/vmx/vmx.c
>@@ -2634,12 +2634,15 @@ static int setup_vmcs_config(struct vmcs_config *vmcs_conf,
> { VM_ENTRY_LOAD_IA32_EFER, VM_EXIT_LOAD_IA32_EFER },
> { VM_ENTRY_LOAD_BNDCFGS, VM_EXIT_CLEAR_BNDCFGS },
> { VM_ENTRY_LOAD_IA32_RTIT_CTL, VM_EXIT_CLEAR_IA32_RTIT_CTL },
>+ { VM_ENTRY_LOAD_IA32_FRED, VM_EXIT_ACTIVATE_SECONDARY_CONTROLS },
This line should be removed. It enforces that "Activate secondary controls"
is supported iff FRED is supported, which isn't true.
Bit 3 of 2nd VM-exit controls is "Prematurely busy shadow stack". Some CPUs
support it, but not FRED.