Skip to content
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

Use VTL-aware direct hypercall to get/set registers when possible #407

Open
wants to merge 2 commits into
base: release/2411
Choose a base branch
from

Conversation

stunes-ms
Copy link
Contributor

Cherry-pick PRs 125 and 360 to release/2411.

Modify ProcessorRunner::get_reg and ProcessorRunner::set_reg to use a
direct hypercall when possible, instead of our dedicated
get/set-register ioctl. Certain registers have special handling in the
kernel ioctl handler. Those are left as-is. Get/set for other registers
is now made with a direct hypercall.

This has the benefit of being VTL-aware, so this change also adds a VTL
parameter.

This change also removes some proliferation of
(g|s)et_vp_registers?(_inner)?, hopefully making it simpler and cleaner.
The singular (g|s)et_vp_register is left as an ergonomic convenience.

One unaddressed capability is making ioctls/hypercalls on a batch of
registers. This is not strictly a regression, because
MSHV_VP_MAX_REGISTERS was previously 1.

This change modifies ProcessorRunner::set_reg and get_reg to
route any VTL-shared register through the special kernel ioctl, and use
the generic hypercall only for registers that are definitely
VTL-private. This ensures that the decision made by get_reg and set_reg
matches the assert in, e.g., get_vp_register_for_vtl.

…crosoft#125)

Modify ProcessorRunner::get_reg and ProcessorRunner::set_reg to use a
direct hypercall when possible, instead of our dedicated
get/set-register ioctl. Certain registers have special handling in the
kernel ioctl handler. Those are left as-is. Get/set for other registers
is now made with a direct hypercall.

This has the benefit of being VTL-aware, so this change also adds a VTL
parameter.

This change also removes some proliferation of
(g|s)et_vp_registers?(_inner)?, hopefully making it simpler and cleaner.
The singular (g|s)et_vp_register is left as an ergonomic convenience.

One unaddressed capability is making ioctls/hypercalls on a batch of
registers. This is not strictly a regression, because
MSHV_VP_MAX_REGISTERS was previously 1.
…oft#360)

microsoft#125 introduced using a generic, VTL-aware hypercall to get and set
VTL-private registers. Unfortunately, it introduced multiple sources of
truth about how certain registers (in particular, Xfem) should be
handled. This change modifies ProcessorRunner::set_reg and get_reg to
route any VTL-shared register through the special kernel ioctl, and use
the generic hypercall only for registers that are definitely
VTL-private. This ensures that the decision made by get_reg and set_reg
matches the assert in, e.g., get_vp_register_for_vtl.
@stunes-ms stunes-ms requested a review from a team as a code owner November 27, 2024 20:33
@github-actions github-actions bot added the release_2411 Targets the release/2411 branch. label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_2411 Targets the release/2411 branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant