virt_kvm: add aarch64 irqfd routing#3419
Open
jstarks wants to merge 1 commit intomicrosoft:mainfrom
Open
Conversation
Move irqfd route construction behind an architecture-specific builder so the shared KVM GSI and irqfd lifetime code can be used outside x86 MSI routing. x86 keeps using the existing MSI translation path, now rejecting invalid MSI addresses before installing routes. aarch64 partitions with a GICv2m frame can now expose irqfd support by translating valid SETSPI messages into irqchip routes.
|
This PR modifies files containing For more on why we check whole files, instead of just diffs, check out the Rustonomicon |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the KVM backend’s irqfd support beyond x86 by moving GSI/irqfd route construction behind an architecture-specific builder, enabling aarch64 guests with a GICv2m MSI frame to translate SETSPI messages into irqchip routes.
Changes:
- Generalize KVM GSI/irqfd routing so both x86 (MSI routing) and aarch64 (GICv2m SETSPI → irqchip routing) can share the same lifetime/state management.
- Add x86-side validation to reject invalid MSI addresses before installing routes/requests.
- Update
vmcore::irqfddocumentation to describe architecture-specific “interrupt message” routing rather than x86-only MSI wording.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| vmm_core/virt_kvm/src/lib.rs | Makes gsi/irqfd state available across architectures by removing x86-only gating and storing KvmIrqFdState in the partition. |
| vmm_core/virt_kvm/src/gsi.rs | Refactors route lifetime management and introduces an architecture-specific routing-entry builder used by irqfd routes. |
| vmm_core/virt_kvm/src/arch/x86_64/mod.rs | Adds MSI address validation and plugs x86 MSI route construction into the new builder-based irqfd route path. |
| vmm_core/virt_kvm/src/arch/aarch64/mod.rs | Adds aarch64 irqfd exposure when GICv2m is present and implements SETSPI→irqchip route translation. |
| vm/vmcore/src/irqfd.rs | Updates trait documentation to describe architecture-specific interrupt message routing (not just x86 MSI). |
Comments suppressed due to low confidence (1)
vm/vmcore/src/irqfd.rs:26
- The
IrqFd::new_irqfd_routedoc still says the event injects the configured "MSI" into the guest, but this module now describes irqfd as injecting an architecture-specific interrupt message. Please update this wording (and similar references like "Clears the MSI routing") to match the generalized semantics.
///
/// Allocates a GSI, creates an event, and registers the event with the
/// hypervisor so that signaling it injects the configured MSI into the
/// guest.
Comment on lines
161
to
162
| /// This actually leaves the route configured, but it disables the irqfd and | ||
| /// clears the `enabled` bool so that `signal` won't. |
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.
Move irqfd route construction behind an architecture-specific builder so the shared KVM GSI and irqfd lifetime code can be used outside x86 MSI routing.
x86 keeps using the existing MSI translation path, now rejecting invalid MSI addresses before installing routes. aarch64 partitions with a GICv2m frame can now expose irqfd support by translating valid SETSPI messages into irqchip routes.