Repository navigation
Conversation
3bd36f7 to
9a1a0d7
Compare
9a1a0d7 to
9284f67
Compare
|
This PR seems to break riscv64. In src/hypercall/mod.rs, the old not(target_arch = "loongarch64") also covered riscv64, but it’s now aarch64 / any(aarch64, loongarch64). As a result, riscv64 fails to build. Even after fixing the build, hv_virtio_inject_irq never advances res_agent and loops forever without injecting any IRQ, and hv_zone_shutdown no longer takes the VIRTIO_IRQS lock or clears the zone’s irq_list. |
| zone.arch_irqchip_reset(); | ||
|
|
||
| #[cfg(target_arch = "x86_64")] | ||
| crate::device::irqchip::pic::ioapic::ioapic_reset(zone_id as usize); |
There was a problem hiding this comment.
Race on x86: ioapic_reset() clears the stopping flag before remove_zone(). A virtio injection from another root CPU in between still passes find_zone() and sets the asserted bit on the reset state. If this zone is started again, it will lose its first edge IRQ or get a spurious level IRQ on unmask.
| IdtVector::VIRT_IPI_VECTOR if !is_timer => { | ||
| ipi::handle_virt_ipi(); | ||
| } | ||
| IdtVector::I8042_KEYBOARD_VECTOR if !is_timer => {} |
There was a problem hiding this comment.
While using Linux 7.2 kernel for testing, I found a problem here.
Linux assigns MSI-X vectors from 0x20 up, so a passed-through device can own 0x21. Filtering it here swallows that device's completion interrupts.
Problem
Linux briefly changes a level-triggered IOAPIC redirection table entry (RTE) to masked + edge while handling EOI. If a virtio completion arrived during that window, hvisor dropped it according to the temporary RTE value, even though the device's interrupt line remained asserted. Zone1 could then hang waiting for I/O, as reported in #409.
Changes