arch: refactor to support windows#675
Open
lstocchi wants to merge 4 commits into
Open
Conversation
e44af52 to
09f5154
Compare
Introduce a hypervisor-agnostic SegmentDescriptor struct and rename kvm_segment_from_gdt to segment_from_gdt. The KVM backend uses a kvm_segment_from conversion helper, proving the agnostic struct works before adding the Windows path. Signed-off-by: lstocchi <lstocchi@redhat.com>
Move the logic that calculates GDT/IDT and page tables into compute_segments() and compute_page_tables() functions that return hypervisor-agnostic BootSegments and BootPageTables structs. Existing KVM setup functions now delegate to these. Signed-off-by: lstocchi <lstocchi@redhat.com>
Update Cargo.toml with conditional dependencies and vm-memory git rev. Introduce src/arch/src/x86_64/linux/ and windows/ folder structures. Move existing Linux/KVM code to linux/ and add platform re-exports with cfg(target_os) conditional compilation. Signed-off-by: lstocchi <lstocchi@redhat.com>
Add the WHP-specific register, segment, and MSR configuration in src/arch/src/x86_64/windows/. Uses structured WHV_REGISTER_VALUE writes for FP registers and proper WHP register name mapping for MSRs. Includes the get_page_size helper for Windows. 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 just contains commits related to the arch crate.
I've refactor it to share common code with Windows and keep linux-only code in the linux folder and windows in windows as done in the rest of the project.
The linux implementation did not change. The windows one copies what's done on linux.