GSI Allocator: free GSIs when they are no longer used#74
Merged
amphi merged 3 commits intocyberus-technology:gardenlinuxfrom Feb 11, 2026
Merged
GSI Allocator: free GSIs when they are no longer used#74amphi merged 3 commits intocyberus-technology:gardenlinuxfrom
amphi merged 3 commits intocyberus-technology:gardenlinuxfrom
Conversation
Member
I think a bitmap is trivial enough to keep the functionality in the module itself |
phip1611
reviewed
Feb 2, 2026
phip1611
reviewed
Feb 2, 2026
94c8bd8 to
f05cdf5
Compare
phip1611
requested changes
Feb 5, 2026
Member
phip1611
left a comment
There was a problem hiding this comment.
I think we can leave this as is, good design! Please address the remaining remarks
63b9784 to
03f5bbd
Compare
phip1611
reviewed
Feb 6, 2026
6e42550 to
6637513
Compare
phip1611
approved these changes
Feb 6, 2026
phip1611
requested changes
Feb 9, 2026
3e168d3 to
bf84265
Compare
phip1611
approved these changes
Feb 9, 2026
bf84265 to
f4fdfcd
Compare
phip1611
reviewed
Feb 10, 2026
tpressure
approved these changes
Feb 10, 2026
The old implementation used a u32 to allocate new GSIs. The counter increased every time a new GSI was allocated, and freeing GSIs was not possible. Thus, Cloud Hypervisor could run out of GSIs and panic. This new implementation can also free GSIs. Please note that this commit only replaces the old mechanism, the next commit will introduce a mechanism to free used GSIs. While I was here I also propagated the errors that the allocator may throw where necessary. On-behalf-of: SAP sebastian.eydam@sap.com Signed-off-by: Sebastian Eydam <sebastian.eydam@cyberus-technology.de>
These changes free GSIs when they are no longer used. That way we won't exhaust the available GSIs anymore when attaching and detaching devices. On-behalf-of: SAP sebastian.eydam@sap.com Signed-off-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>
f4fdfcd to
35ea140
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR changes the
GsiAllocatorto enable it to free GSIs when they are no longer used. To do that, it replaces theu32that was used to track used GSIs with a simple bitmap. If you know a good bitmap crate that I should use, please tell me.While I was here, I also made sure that errors from the allocator a propagated. I also used the bitmap for the IRQs of the
GsiAllocator, just because it made it easier for me to propagate useful errors.I am not completely sure whether I free the GSIs at all necessary places.