-
Notifications
You must be signed in to change notification settings - Fork 138
Fix Windows build with --no-default-features
#712
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
base: main
Are you sure you want to change the base?
Conversation
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.
Looks good! I think we should strive to set the same registers on all hypervisors, so we don't rely on any inherent defaults of a particular hv. Thoughts?
c8511cc
to
fe110fb
Compare
Probably a good idea—we should also avoid relying on
This is exactly the setup we needed w/o Might be a good work item for #469? |
Signed-off-by: danbugs <danilochiarlone@gmail.com>
Signed-off-by: danbugs <danilochiarlone@gmail.com>
2c28574
to
85e2184
Compare
@@ -399,16 +402,22 @@ impl HypervWindowsDriver { | |||
])?; | |||
|
|||
#[cfg(not(feature = "init-paging"))] | |||
proc.set_registers(&[( |
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.
Does this change need to be mirrored on the Linux hypervisor drivers?
{{ if os() == "linux" { "! cargo check -p hyperlight-host --no-default-features 2> /dev/null"} else { "" } }} | ||
# tests compilation with no default features on different platforms | ||
test-compilation-no-default-features target=default-target: | ||
@# Linux should fail without a hypervisor feature (kvm, mshv, or mshv3) |
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.
Should we also be checking that compilation with a hypervisor driver but without init-paging succeeds on Linux?
Fixes #685 and updates CI to ensure Windows builds successfully without default features.
Btw, to validate this fix, I tested running Nanvix (which uses
--no-default-features
) on Windows as a guest. This revealed that additional register setup was needed inhyperv_windows.rs
:Limit
parameter for CS to0xFFFF
(required when paging isn't initialized)These changes ensure Windows Hyper-V properly initializes guest VMs that don't use the init-paging feature.