Skip to content

Commit 93081fd

Browse files
committed
virtio: Support live PCI queue MSI-X mapping
Virtio 1.2 sections 4.1.5.1.2.1 and 4.1.5.3.1 require event mapping, unmapping and suppression of queue interrupts for NO_VECTOR. Allow queue MSI-X mapping and unmapping after DRIVER_OK while preserving queue configuration restrictions. Validate vectors against the MSI-X table and report rejected mappings through NO_VECTOR. Keep a stable event for each queue so vhost backends retain direct irqfd delivery across mapping changes. Update routes when MSI-X table entries or masks change. Preserve pending interrupts on the old vector and drop events received while the queue is unmapped. Save pending interrupts and rebuild routes from restored MSI-X state. Reconstruct queue mappings on activation and restore, and unmap them on reset. Preserve INTx and MMIO interrupt behavior. Add regression tests for live routing, stable events, interrupt suppression, shared vectors, queue size protection and lifecycle transitions. Verify that irqfd delivery does not require EventProxy. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
1 parent a22173a commit 93081fd

5 files changed

Lines changed: 693 additions & 52 deletions

File tree

‎Cargo.lock‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6559,6 +6559,7 @@ dependencies = [
65596559
"open_enum",
65606560
"pal_event",
65616561
"parking_lot",
6562+
"test_with_tracing",
65626563
"thiserror 2.0.16",
65636564
"tracelimit",
65646565
"tracing",

‎vm/devices/pci/pci_core/Cargo.toml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,9 @@ thiserror.workspace = true
2222
tracelimit.workspace = true
2323
tracing.workspace = true
2424
zerocopy.workspace = true
25+
26+
[dev-dependencies]
27+
test_with_tracing.workspace = true
28+
2529
[lints]
2630
workspace = true

0 commit comments

Comments
 (0)