Re: [PATCH v10 22/28] KVM: nVMX: Restrict event data VMCS fields to FRED-supported hosts
From: Binbin Wu
Date: Wed Nov 04 2026 - 01:59:01 EST
On 9/12/2026 5:36 AM, Sohil Mehta wrote:
> From: Xin Li <xin@xxxxxxxxx>
>
> Prevent L1 from accessing the ORIGINAL_EVENT_DATA and INJECTED_EVENT_DATA
> VMCS fields via VMREAD or VMWRITE when FRED support is disabled or not
> present in KVM.
I think the change log should tell why the patch only restricts event data
fields.
>
> Signed-off-by: Xin Li <xin@xxxxxxxxx>
> Signed-off-by: Sohil Mehta <sohil.mehta@xxxxxxxxx>
> ---
> v10:
> - Split out of "KVM: nVMX: Guard SHADOW_FIELD_R[OW] macros with VMX
> feature checks" and renamed (Sean).
> ---
> arch/x86/kvm/vmx/vmcs12.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/x86/kvm/vmx/vmcs12.c b/arch/x86/kvm/vmx/vmcs12.c
> index 837cb3d568c3..67c730e31465 100644
> --- a/arch/x86/kvm/vmx/vmcs12.c
> +++ b/arch/x86/kvm/vmx/vmcs12.c
> @@ -222,6 +222,9 @@ static __init bool cpu_has_vmcs12_field(unsigned int idx)
> case HOST_SSP:
> case HOST_INTR_SSP_TABLE:
> return cpu_has_load_cet_ctrl();
> + VMCS12_CASE64(ORIGINAL_EVENT_DATA):
> + VMCS12_CASE64(INJECTED_EVENT_DATA):
> + return cpu_has_vmx_fred();
>
> /* KVM always emulates PML and the VMX preemption timer in software. */
> case GUEST_PML_INDEX: