diff options
| -rw-r--r-- | arch/x86/kvm/vmx.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index f910d33858d9..533a327372c8 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
| @@ -12537,8 +12537,11 @@ static int enter_vmx_non_root_mode(struct kvm_vcpu *vcpu, u32 *exit_qual) | |||
| 12537 | struct vmcs12 *vmcs12 = get_vmcs12(vcpu); | 12537 | struct vmcs12 *vmcs12 = get_vmcs12(vcpu); |
| 12538 | bool from_vmentry = !!exit_qual; | 12538 | bool from_vmentry = !!exit_qual; |
| 12539 | u32 dummy_exit_qual; | 12539 | u32 dummy_exit_qual; |
| 12540 | u32 vmcs01_cpu_exec_ctrl; | ||
| 12540 | int r = 0; | 12541 | int r = 0; |
| 12541 | 12542 | ||
| 12543 | vmcs01_cpu_exec_ctrl = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL); | ||
| 12544 | |||
| 12542 | enter_guest_mode(vcpu); | 12545 | enter_guest_mode(vcpu); |
| 12543 | 12546 | ||
| 12544 | if (!(vmcs12->vm_entry_controls & VM_ENTRY_LOAD_DEBUG_CONTROLS)) | 12547 | if (!(vmcs12->vm_entry_controls & VM_ENTRY_LOAD_DEBUG_CONTROLS)) |
| @@ -12575,6 +12578,25 @@ static int enter_vmx_non_root_mode(struct kvm_vcpu *vcpu, u32 *exit_qual) | |||
| 12575 | } | 12578 | } |
| 12576 | 12579 | ||
| 12577 | /* | 12580 | /* |
| 12581 | * If L1 had a pending IRQ/NMI until it executed | ||
| 12582 | * VMLAUNCH/VMRESUME which wasn't delivered because it was | ||
| 12583 | * disallowed (e.g. interrupts disabled), L0 needs to | ||
| 12584 | * evaluate if this pending event should cause an exit from L2 | ||
| 12585 | * to L1 or delivered directly to L2 (e.g. In case L1 don't | ||
| 12586 | * intercept EXTERNAL_INTERRUPT). | ||
| 12587 | * | ||
| 12588 | * Usually this would be handled by L0 requesting a | ||
| 12589 | * IRQ/NMI window by setting VMCS accordingly. However, | ||
| 12590 | * this setting was done on VMCS01 and now VMCS02 is active | ||
| 12591 | * instead. Thus, we force L0 to perform pending event | ||
| 12592 | * evaluation by requesting a KVM_REQ_EVENT. | ||
| 12593 | */ | ||
| 12594 | if (vmcs01_cpu_exec_ctrl & | ||
| 12595 | (CPU_BASED_VIRTUAL_INTR_PENDING | CPU_BASED_VIRTUAL_NMI_PENDING)) { | ||
| 12596 | kvm_make_request(KVM_REQ_EVENT, vcpu); | ||
| 12597 | } | ||
| 12598 | |||
| 12599 | /* | ||
| 12578 | * Note no nested_vmx_succeed or nested_vmx_fail here. At this point | 12600 | * Note no nested_vmx_succeed or nested_vmx_fail here. At this point |
| 12579 | * we are no longer running L1, and VMLAUNCH/VMRESUME has not yet | 12601 | * we are no longer running L1, and VMLAUNCH/VMRESUME has not yet |
| 12580 | * returned as far as L1 is concerned. It will only return (and set | 12602 | * returned as far as L1 is concerned. It will only return (and set |
