-
Notifications
You must be signed in to change notification settings - Fork 154
Move sregs to its own file #1043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
danbugs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the special register (sregs) initialization code by moving default values and constants from mod.rs to special_regs.rs, and removes obsolete Rust 2015-style extern crate declarations throughout the codebase. The changes improve code organization by consolidating related functionality while modernizing the import style to Rust 2018+ conventions.
Key changes:
- Moved CR0, CR4, and EFER constants from
hypervisor/mod.rstohypervisor/regs/special_regs.rs - Created
standard_64bit_defaults()andstandard_real_mode_defaults()methods onCommonSpecialRegistersto encapsulate default register configurations - Removed
extern cratedeclarations formshv_bindingsandmshv_ioctlsfrom 7 files - Updated import in
hyperv_linux.rsdebug module fromsuper::mshv_bindingstomshv_bindings
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/hyperlight_host/src/mem/memory_region.rs |
Removed obsolete extern crate declarations for mshv crates |
src/hyperlight_host/src/hypervisor/regs/standard_regs.rs |
Removed obsolete extern crate declarations for mshv crates |
src/hyperlight_host/src/hypervisor/regs/special_regs.rs |
Added CR0/CR4/EFER constants and two new methods for default register configurations |
src/hyperlight_host/src/hypervisor/regs/fpu.rs |
Removed obsolete extern crate declarations for mshv crates |
src/hyperlight_host/src/hypervisor/mod.rs |
Refactored setup_initial_sregs() to use new default methods; removed constants and unused import; contains bug with CR3 not being set |
src/hyperlight_host/src/hypervisor/hyperv_linux.rs |
Removed obsolete extern crate declarations; updated import path in debug module |
src/hyperlight_host/src/hypervisor/gdb/mshv_debug.rs |
Removed obsolete extern crate declarations for mshv crates |
src/hyperlight_host/src/error.rs |
Removed obsolete extern crate declaration for mshv_ioctls |
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
Move sregs default values to its own file and removes some old
extern crateusages