devices: add IOAPIC support for Windows Hypervisor Platform#692
Open
lstocchi wants to merge 2 commits into
Open
devices: add IOAPIC support for Windows Hypervisor Platform#692lstocchi wants to merge 2 commits into
lstocchi wants to merge 2 commits into
Conversation
This commit refactors the IOAPIC emulation logic to decouple common register state management from hypervisor-specific interrupt injection. This is a prerequisite for supporting the Windows Hypervisor Platform (WHP). It introduces the IoApicBackend trait to handle backend-specific logic such as interrupt routing updates and injection. It moves the register state into a dedicated IoApicRegs struct, making the core IoApic struct generic over the backend (IoApic<B: IoApicBackend>) and place KVM-sspecific implementation into a new ioapic_kvm.rs file. Assisted-by: Cursor:claude-opus-4.6 Signed-off-by: lstocchi <lstocchi@redhat.com>
WHP emulates the LAPIC but not the IOAPIC. Add a WhpIoapicBackend that plugs into the common IOAPIC register emulation and delivers interrupts through WHvRequestInterrupt. The backend translates IOAPIC redirection-table entries into WHP InterruptRequest structs, handling physical/logical destination modes, edge/level trigger modes, and delivery modes (Fixed, LowestPriority, NMI, INIT, SIPI). Level-triggered interrupts track Remote-IRR as the KVM backend does. Assisted-by: Cursor:claude-opus-4.6 Signed-off-by: lstocchi <lstocchi@redhat.com>
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 adds IOAPIC support for Windows by refactoring the existing KVM-only IOAPIC implementation into a backend-agnostic design. The existing KVM logic moves to ioapic_kvm.rs with no behavioral changes.
ioapic_whp.rs is dedicated to Windows and it translates IOAPIC redirection-table entries into WHP InterruptRequest structs, handling physical/logical destination modes, edge/level triggers, and delivery modes (Fixed, LowestPriority, NMI, INIT, SIPI).