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

Add hv headers directly in the repo #165

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

NunoDasNeves
Copy link
Collaborator

Summary of the PR

The hv headers are leaving the kernel uapi directory.
The goal is to only use these for 'passthrough' parts of the interface - i.e. the generic hypercall IOCTL and run vp IOCTL.

@russell-islam
Copy link
Collaborator

Could you pleas elaborate more details of the purpose?

  1. Why we are keeping this here?
  2. Are we keeping another copy in the Kernel too?
  3. How do we sync in case of modifications?
  4. Are these only needed for rust-crates?

@NunoDasNeves
Copy link
Collaborator Author

  1. Why we are keeping this here?

So it doesn't have to live in kernel uapi, with all the baggage that carries.

  1. Are we keeping another copy in the Kernel too?

Yes, although the copies need not contain all the same definitions; the interfaces we use in the kernel are not exactly the same as those we need in userspace.
I will make a pass to delete a lot of the parts we don't need in userspace.

  1. How do we sync in case of modifications?

Ideally these hypervisor interfaces don't need to change - they are backward compatible. Adding new things is easy; just add the definitions.
For some experimental interfaces that could change, we could keep them separated if we really want to.

  1. Are these only needed for rust-crates?

Any userspace library using our interface will need to know how to use the passthru interfaces.

@@ -47,13 +51,19 @@ def generate_unified_mshv_headers(kernel_hdr_path):
fp.write("typedef _Bool bool;\n")
data = ""

for header in hv_header_files:
header_path = f"{hv_headers_path}/{header}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if someone runs the script from scripts directory?

Copy link
Collaborator

@russell-islam russell-islam Sep 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it better to use absolute path?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea, i'll fix it

Note these are from the 6.6 kernel. There is no breaking change to the
uapi from 5.15, however.

Add defintion for __packed at the top of hvgdk_mini.h

Signed-off-by: Nuno Das Neves <[email protected]>
There are many many redundant definitions that are only used in the
kernel. Remove most of these - further pruning is probably needed.

Signed-off-by: Nuno Das Neves <[email protected]>
MSHV_DEV_VFIO_GROUP-prefixed names have changed to MSHV_DEV_VFIO_FILE
in the newly generated bindings. The values remain the same.

Signed-off-by: Nuno Das Neves <[email protected]>
@russell-islam
Copy link
Collaborator

Could you please look into the clippy error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants