Skip to content

Commit 8e29615

Browse files
ywan170lijinxia
authored andcommitted
hv: apicv: enable interrupt-window if any pending external interrupts
The external interrupt events only can be inject if RFLAGS.IF = 1 and no blocking by both STI and MOV SS. If met this scenario, we need to enable "interrupt-window exiting" for injection in next VMEXIT. Tracked-On: #1189 Signed-off-by: Yu Wang <yu1.wang@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
1 parent 46c3276 commit 8e29615

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

hypervisor/arch/x86/virq.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,9 +495,18 @@ int acrn_handle_pending_request(struct vcpu *vcpu)
495495
* and automatic inject the virtual interrupts in appropriate time.
496496
* And from SDM Vol3 29.2.1, the apicv only trigger evaluation of
497497
* pending virtual interrupts when "interrupt-window exiting" is 0.
498+
*
499+
* External interrupt(from vpic) can't be delivered by "virtual-
500+
* interrupt delivery", it only deliver interrupt from vlapic.
501+
*
502+
* So need to enable "interrupt-window exiting", when there is
503+
* an ExtInt or there is lapic interrupt and virtual interrupt
504+
* deliver is disabled.
498505
*/
499-
if (is_apicv_intr_delivery_supported() ||
500-
!vcpu_pending_request(vcpu)) {
506+
if (!bitmap_test(ACRN_REQUEST_EXTINT,
507+
pending_req_bits) &&
508+
(is_apicv_intr_delivery_supported() ||
509+
!vcpu_pending_request(vcpu))) {
501510
return ret;
502511
}
503512

0 commit comments

Comments
 (0)