[prev in list] [next in list] [prev in thread] [next in thread] 

List:       netbsd-tech-kern
Subject:    Allocating interrupts for VirtIO
From:       el16095 <el16095 () mail ! ntua ! gr>
Date:       2023-01-28 17:42:12
Message-ID: 31cfb4971044467f59424e827c89de27 () mail ! ntua ! gr
[Download RAW message or body]

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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic