Skip to content

Commit 8d38318

Browse files
ywan170wenlingz
authored andcommitted
hv: virq: disable interrupt-window exiting in vmexit handler
In interrupt-window exiting handler, disable it directly even there has pending interrupts. The later acrn_handle_pending_request will re-evaluation and re-enable it if needed. Signed-off-by: Yu Wang <yu1.wang@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
1 parent f4513f9 commit 8d38318

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

hypervisor/arch/x86/virq.c

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -337,22 +337,13 @@ int interrupt_window_vmexit_handler(struct vcpu *vcpu)
337337

338338
TRACE_2L(TRACE_VMEXIT_INTERRUPT_WINDOW, 0UL, 0UL);
339339

340-
if (vcpu == NULL)
341-
return -1;
342-
343-
if (vcpu_pending_request(vcpu)) {
344-
/* Do nothing
345-
* acrn_handle_pending_request will continue for this vcpu
346-
*/
347-
} else {
348-
/* No interrupts to inject.
349-
* Disable the interrupt window exiting
350-
*/
351-
vcpu->arch_vcpu.irq_window_enabled = 0U;
352-
value32 = exec_vmread32(VMX_PROC_VM_EXEC_CONTROLS);
353-
value32 &= ~(VMX_PROCBASED_CTLS_IRQ_WIN);
354-
exec_vmwrite32(VMX_PROC_VM_EXEC_CONTROLS, value32);
355-
}
340+
/* Disable interrupt-window exiting first.
341+
* acrn_handle_pending_request will continue handle for this vcpu
342+
*/
343+
vcpu->arch_vcpu.irq_window_enabled = 0U;
344+
value32 = exec_vmread32(VMX_PROC_VM_EXEC_CONTROLS);
345+
value32 &= ~(VMX_PROCBASED_CTLS_IRQ_WIN);
346+
exec_vmwrite32(VMX_PROC_VM_EXEC_CONTROLS, value32);
356347

357348
vcpu_retain_rip(vcpu);
358349
return 0;

0 commit comments

Comments
 (0)