mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-25 06:51:49 +00:00
hv: virq: make irq_window_enabled useful
The arch_vcpu->irq_window_enabled is almost useless in original code. This patch use it to avoid unnecessary "interrupt-window exiting" conditions check if "interrupt-window exiting" is aleady enabled. Tracked-On: #1190 Signed-off-by: Yu Wang <yu1.wang@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
parent
8e296155d5
commit
b4e03f2d68
@ -503,6 +503,10 @@ INTR_WIN:
|
||||
* an ExtInt or there is lapic interrupt and virtual interrupt
|
||||
* deliver is disabled.
|
||||
*/
|
||||
if (arch_vcpu->irq_window_enabled == 1U) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (!bitmap_test(ACRN_REQUEST_EXTINT,
|
||||
pending_req_bits) &&
|
||||
(is_apicv_intr_delivery_supported() ||
|
||||
@ -510,13 +514,10 @@ INTR_WIN:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Enable interrupt window exiting if pending */
|
||||
if (arch_vcpu->irq_window_enabled == 0U) {
|
||||
arch_vcpu->irq_window_enabled = 1U;
|
||||
tmp = exec_vmread32(VMX_PROC_VM_EXEC_CONTROLS);
|
||||
tmp |= VMX_PROCBASED_CTLS_IRQ_WIN;
|
||||
exec_vmwrite32(VMX_PROC_VM_EXEC_CONTROLS, tmp);
|
||||
}
|
||||
tmp = exec_vmread32(VMX_PROC_VM_EXEC_CONTROLS);
|
||||
tmp |= VMX_PROCBASED_CTLS_IRQ_WIN;
|
||||
exec_vmwrite32(VMX_PROC_VM_EXEC_CONTROLS, tmp);
|
||||
arch_vcpu->irq_window_enabled = 1U;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user