You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm opening this issue to start the discussion around adding interrupt abstractions to the vm-device crate.
Motivation
Firecracker is working on adding support for PCI devices which naturally require support for MSI/MSI-X interrupts. CloudHypervisor already has PCI support implemented and has added support for MSI interrupts. Firecracker currently does not support MSI interrupts and uses a very simple model based on irqfds to implement interrupt delivery.
There is a large amount of device code that can be reused and shared across both CloudHypervisor and Firecracker that is not quite interoperable between VMMs today, one of the reasons being that they use different ways to work with interrupts.
Requirements
The goal is to create some abstractions in vm-device that can model the interface for working with interrupts.
This would allow devices to have VMM-independent implementations that can be reused.
Devices should be able to:
generate events that signal and interrupt the VM vCPUs
configure interrupts based on a pre-defined specification
enable/disable interrupt generation
mask/unmask interrupts
request new interrupts
The VMM should be able to:
implement different interrupt mechanisms based on the machine specification
manage interrupt sources
deliver events generated by the devices to the vCPUs
not need device specific knowledge or implementation (apart from standard configuration templates)
General requirements:
interrupt events should not depend on the type of hypervisor used by the VM
while new interrupt mechanisms rarely get added, the interfaces should allow for future extension and addition of new interrupt types
vm-device can hold standard interfaces and templates for common interrupt types (e.g. ISA, INTx, MSI)
Even though the interface will allow VMMs to implement interrupt mechanisms independently, it may be a good idea to also have a reference implementation in vm-device for a common use-case (e.g. KVM in-kernel IRQChip).
We're working on proposal and a POC in Firecracker to showcase how this interface would work. The proposal is based on the previous work mentioned above and satisfies the requirements listed.
It would be great if we can get more input on the requirements of this interface.
The text was updated successfully, but these errors were encountered:
I'm opening this issue to start the discussion around adding interrupt abstractions to the vm-device crate.
Motivation
Firecracker is working on adding support for PCI devices which naturally require support for MSI/MSI-X interrupts. CloudHypervisor already has PCI support implemented and has added support for MSI interrupts. Firecracker currently does not support MSI interrupts and uses a very simple model based on irqfds to implement interrupt delivery.
There is a large amount of device code that can be reused and shared across both CloudHypervisor and Firecracker that is not quite interoperable between VMMs today, one of the reasons being that they use different ways to work with interrupts.
Requirements
The goal is to create some abstractions in vm-device that can model the interface for working with interrupts.
This would allow devices to have VMM-independent implementations that can be reused.
Devices should be able to:
The VMM should be able to:
General requirements:
Even though the interface will allow VMMs to implement interrupt mechanisms independently, it may be a good idea to also have a reference implementation in vm-device for a common use-case (e.g. KVM in-kernel IRQChip).
Prior work
There have been several PRs to add Interrupt management support to vm-device (#21 and #23).
There is also a different vm-device fork implementing these types of abstractions in the Cloud Hypervisor Github org (cloud-hypervisor#5) and an implementation that Cloud Hypervisor uses (https://github.com/cloud-hypervisor/cloud-hypervisor/blob/main/vm-device/src/interrupt/mod.rs).
Crossvm is using a similar interface the Trigger proposal (called Event) and adds functionality around that primitive when needed by sending requests to the hypervisor (e.g. VmIrqRequest) through a Tube (https://chromium.googlesource.com/chromiumos/platform/crosvm/+/refs/heads/main/devices/src/pci/vfio_pci.rs#178).
Next steps
We're working on proposal and a POC in Firecracker to showcase how this interface would work. The proposal is based on the previous work mentioned above and satisfies the requirements listed.
It would be great if we can get more input on the requirements of this interface.
The text was updated successfully, but these errors were encountered: