Skip to content

Commit b1f7723

Browse files
committed
KVM: x86: Isolate edge vs. level check in userspace I/O APIC route scanning
Extract and isolate the trigger mode check in kvm_scan_ioapic_routes() in anticipation of moving destination matching logic to a common helper (for userspace vs. in-kernel I/O APIC emulation). No functional change intended. Reviewed-by: Kai Huang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent d88bb2d commit b1f7723

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

arch/x86/kvm/irq_comm.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,12 @@ void kvm_scan_ioapic_routes(struct kvm_vcpu *vcpu,
424424

425425
kvm_set_msi_irq(vcpu->kvm, entry, &irq);
426426

427-
if (irq.trig_mode &&
428-
(kvm_apic_match_dest(vcpu, NULL, APIC_DEST_NOSHORT,
429-
irq.dest_id, irq.dest_mode) ||
430-
kvm_apic_pending_eoi(vcpu, irq.vector)))
427+
if (!irq.trig_mode)
428+
continue;
429+
430+
if (kvm_apic_match_dest(vcpu, NULL, APIC_DEST_NOSHORT,
431+
irq.dest_id, irq.dest_mode) ||
432+
kvm_apic_pending_eoi(vcpu, irq.vector))
431433
__set_bit(irq.vector, ioapic_handled_vectors);
432434
}
433435
}

0 commit comments

Comments
 (0)