mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
The old implementation used an ever monotonically increasing u32 counter to allocate new GSIs. The counter increased every time a new GSI was allocated, and freeing GSIs was not possible. Thus, Cloud Hypervisor can run out of GSIs and panics. This currently happened at the 1024th GSI [0]. Further, this caused the `KVM_SET_GSI_ROUTING` ioctl to carry much more payload than needed. This new implementation uses a bitmap for proper tracking of resources and can gracefully free GSIs - this is abstracted in type InterruptAllocator. Please note that this commit only replaces the old mechanism. The next commit will introduce freeing used GSIs automatically when an InterruptRoute is dropped. While being on this, we also propagate the errors that the allocator may throw where necessary. Co-authored-by: Sebastian Eydam <sebastian.eydam@cyberus-technology.de> On-behalf-of: SAP sebastian.eydam@sap.com Signed-off-by: Sebastian Eydam <sebastian.eydam@cyberus-technology.de> On-behalf-of: Philipp Schuster@sap.com Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>