Skip to content

Commit 2e5b0bd

Browse files
jsmattsonjrbonzini
authored andcommitted
kvm: nVMX: Don't validate disabled secondary controls
According to the SDM, if the "activate secondary controls" primary processor-based VM-execution control is 0, no checks are performed on the secondary processor-based VM-execution controls. Signed-off-by: Jim Mattson <jmattson@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 0266c89 commit 2e5b0bd

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎arch/x86/kvm/vmx.c‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10240,9 +10240,10 @@ static int check_vmentry_prereqs(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12)
1024010240
if (!vmx_control_verify(vmcs12->cpu_based_vm_exec_control,
1024110241
vmx->nested.nested_vmx_procbased_ctls_low,
1024210242
vmx->nested.nested_vmx_procbased_ctls_high) ||
10243-
!vmx_control_verify(vmcs12->secondary_vm_exec_control,
10244-
vmx->nested.nested_vmx_secondary_ctls_low,
10245-
vmx->nested.nested_vmx_secondary_ctls_high) ||
10243+
(nested_cpu_has(vmcs12, CPU_BASED_ACTIVATE_SECONDARY_CONTROLS) &&
10244+
!vmx_control_verify(vmcs12->secondary_vm_exec_control,
10245+
vmx->nested.nested_vmx_secondary_ctls_low,
10246+
vmx->nested.nested_vmx_secondary_ctls_high)) ||
1024610247
!vmx_control_verify(vmcs12->pin_based_vm_exec_control,
1024710248
vmx->nested.nested_vmx_pinbased_ctls_low,
1024810249
vmx->nested.nested_vmx_pinbased_ctls_high) ||

0 commit comments

Comments
 (0)