From: Isaku Yamahata Add checks of VMX controls for APIC timer virtualization on VM entries. The spec adds some checks on VMX controls related to the APIC timer virtualization on VM entry. Signed-off-by: Isaku Yamahata --- arch/x86/kvm/vmx/nested.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c index 3f1318736205..65f7260d02df 100644 --- a/arch/x86/kvm/vmx/nested.c +++ b/arch/x86/kvm/vmx/nested.c @@ -3069,6 +3069,12 @@ static int nested_check_vm_execution_controls(struct kvm_vcpu *vcpu, CC(!vmcs12->tsc_multiplier)) return -EINVAL; + if (nested_cpu_has_guest_apic_timer(vmcs12) && + (CC(!nested_cpu_has_vid(vmcs12)) || + CC(nested_cpu_has(vmcs12, CPU_BASED_RDTSC_EXITING)) || + CC(vmcs12->virtual_timer_vector > 255))) + return -EINVAL; + return 0; } -- 2.45.2