-
Notifications
You must be signed in to change notification settings - Fork 104
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
expose fields for KVM_EXIT_HYPERCALL #267
Conversation
This is needed for userspace to handle the `KVM_HC_MAP_GPA_RANGE` hypercall. Signed-off-by: Tom Dohrmann <[email protected]>
Signed-off-by: Tom Dohrmann <[email protected]>
Signed-off-by: Tom Dohrmann <[email protected]>
Signed-off-by: Tom Dohrmann <[email protected]>
@@ -167,4 +167,5 @@ pub enum Cap { | |||
ArmPtrAuthGeneric = KVM_CAP_ARM_PTRAUTH_GENERIC, | |||
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] | |||
X86UserSpaceMsr = KVM_CAP_X86_USER_SPACE_MSR, | |||
ExitHypercall = KVM_CAP_EXIT_HYPERCALL, |
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.
I think this is only defined for x86_64 and arm64. From kvm-bindings:
$ git grep KVM_CAP_EXIT_HYPERCALL
src/arm64/bindings.rs:pub const KVM_CAP_EXIT_HYPERCALL: u32 = 201;
src/x86_64/bindings.rs:pub const KVM_CAP_EXIT_HYPERCALL: u32 = 201;
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.
Interestingly, the docs say this is only available for x86(-64):
https://docs.kernel.org/virt/kvm/api.html#kvm-cap-exit-hypercall
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.
Isn't that because kvm-bindings
only supports x86_64 and arm64? I can't find definitions for any KVM_CAP_*
outside of those two files.
AFAICT KVM_CAP_EXIT_HYPERCALL
is defined in a non-architecture-specific header.
That said KVM currently only implements KVM_CAP_EXIT_HYPERCALL
on x86_64, so I'd also be fine with restricting it to that platform.
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.
Interestingly, the docs say this is only available for x86(-64): https://docs.kernel.org/virt/kvm/api.html#kvm-cap-exit-hypercall
If that's what to official docs say, that seems like a good reason to restrict it to x86_64 :)
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.
Isn't that because
kvm-bindings
only supports x86_64 and arm64? I can't find definitions for anyKVM_CAP_*
outside of those two files.
Ah yes, that could be it.
According to the official docs, this capability is only supported on x86. Signed-off-by: Tom Dohrmann <[email protected]>
This is a breaking change.
Summary of the PR
This is needed for userspace to handle the
KVM_HC_MAP_GPA_RANGE
hypercall.Requirements
Before submitting your PR, please make sure you addressed the following
requirements:
git commit -s
), and the commit message has max 60 characters for thesummary and max 75 characters for each description line.
test.
Release" section of CHANGELOG.md (if no such section exists, please create one).
unsafe
code is properly documented.