fix(armv8/vgic): correct addressing of forwarded register writes - #394
Open
josecm wants to merge 5 commits into
Open
fix(armv8/vgic): correct addressing of forwarded register writes#394josecm wants to merge 5 commits into
josecm wants to merge 5 commits into
Conversation
Signed-off-by: Jose Martins <josemartins90@gmail.com>
The message sent to the interrupt owner's cpu hardcoded vgicr id 0, so a write to a private interrupt register of another vcpu's redistributor was applied to vcpu 0's interrupt instead of the intended one. Signed-off-by: Jose Martins <josemartins90@gmail.com>
The router emulation merged partial word writes against a route value that could be behind an in-flight forward to a remote interrupt owner, so the second half of a split 64-bit guest write could resurrect the old route and the update was silently lost. It also truncated the forwarded value to the 8-bit message val field. Update the route and the physical routing at the access site under the interrupt lock, where merges always see the current value, and reduce the message to the owner to a data-less request to re-evaluate the routing. Signed-off-by: Jose Martins <josemartins90@gmail.com>
A doubleword read of IROUTER returned only the low word, truncating Aff3. Signed-off-by: Jose Martins <josemartins90@gmail.com>
josecm
force-pushed
the
fix/vgic-set-reg-vgicr-id
branch
from
August 21, 2026 18:23
e75b26a to
bae2acf
Compare
danielRep
self-requested a review
August 28, 2026 09:52
On GICv3 private interrupts were initialized without an owner and vgic_yield_ownership could clear the owner again, so a core emulating a write to another vcpu's redistributor could take ownership and handle the access in place, manipulating another vcpu's banked interrupt state from the wrong core. Initialize the owner to the vcpu, as already done for GICv2, and never yield it, so remote accesses are always forwarded to the owning core. Signed-off-by: Jose Martins <josemartins90@gmail.com>
Member
Author
|
Pushed one more fix in 54a6eb4: on GICv3, private interrupts were initialized without an owner, so a core emulating a write to another vcpu's redistributor could take ownership and handle the access in place instead of forwarding it to the owning core. Private interrupt ownership is now pinned to the vcpu, as already on GICv2, so those writes always go through the owning core, where the vgicr id fix makes them land on the right interrupt. |
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.
Four bugs in the vgic register emulation, plus a preparatory refactor of the message encoding.
The forwarding fixes trigger whenever the written interrupt is owned by a vcpu on another cpu, which with the ownership pinning now includes every write to another vcpu's private interrupt registers. Build-tested for GICv3 and GICv2 on qemu-aarch64-virt, and GICv3 on mps3-an536 (aarch32). The route update path is exercised at runtime by a guest test that cycles an SPI's route across all cpus and verifies each delivery lands on the routed cpu.