tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Allocating interrupts for VirtIO



Hello,

I'm trying to write a driver that sets up VirtIO through the MMIO transport layer to be used alongside the Firecracker VMM. I've progressed a lot with it, but now comes the time I must code the interrupt allocation and I'm not entirely sure how to go about it.

I've seen that in evbarm implementations of VirtIO-MMIO, the interrupts are handled through the device virtio attaches to (fdt or acpi) and the same happens with pci in the implementation of VirtIO-PCI. However, in the case of Firecracker the MMIO data is passed through the boot commandline and there's no device that we are attaching to. Since I'm specifically working on the amd64 architecture, I thought I could use the IOAPIC device, but I'm not sure how that would work exactly. I imagine I'd need to make sure IOAPIC attaches to mainbus, but after that I'm not sure how to register the interrupt handler on the desired irq number.

Firecracker states "In addition to the Firecracker provided device models, guests also see the Programmable Interrupt Controllers (PICs), the I/O Advanced Programmable Interrupt Controller (IOAPIC), and the Programmable Interval Timer (PIT) that KVM supports". So, IOAPIC should be available (as well as maybe some PIC alternatives; not sure if it's a good idea to try to use those).


Any advice would be appreciated. Thanks in advance.

--
George Gkanas


Home | Main Index | Thread Index | Old Index