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:
Yu Wang 2018-09-06 03:08:34 +00:00 committed by lijinxia
parent 8e296155d5
commit b4e03f2d68

View File

@ -503,6 +503,10 @@ INTR_WIN:
* an ExtInt or there is lapic interrupt and virtual interrupt * an ExtInt or there is lapic interrupt and virtual interrupt
* deliver is disabled. * deliver is disabled.
*/ */
if (arch_vcpu->irq_window_enabled == 1U) {
return ret;
}
if (!bitmap_test(ACRN_REQUEST_EXTINT, if (!bitmap_test(ACRN_REQUEST_EXTINT,
pending_req_bits) && pending_req_bits) &&
(is_apicv_intr_delivery_supported() || (is_apicv_intr_delivery_supported() ||
@ -510,13 +514,10 @@ INTR_WIN:
return ret; return ret;
} }
/* Enable interrupt window exiting if pending */ tmp = exec_vmread32(VMX_PROC_VM_EXEC_CONTROLS);
if (arch_vcpu->irq_window_enabled == 0U) { tmp |= VMX_PROCBASED_CTLS_IRQ_WIN;
arch_vcpu->irq_window_enabled = 1U; exec_vmwrite32(VMX_PROC_VM_EXEC_CONTROLS, tmp);
tmp = exec_vmread32(VMX_PROC_VM_EXEC_CONTROLS); arch_vcpu->irq_window_enabled = 1U;
tmp |= VMX_PROCBASED_CTLS_IRQ_WIN;
exec_vmwrite32(VMX_PROC_VM_EXEC_CONTROLS, tmp);
}
return ret; return ret;
} }