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

Minor QoL improvements for kvm_xsave2 #315

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

roypat
Copy link
Member

@roypat roypat commented Mar 10, 2025

  • add a way to convert kvm_xsave to kvm_xsave2 more easily
  • fix the doc comment on kvm_xsave2.len

Summary of the PR

Please summarize here why the changes in this PR are needed.

Requirements

Before submitting your PR, please make sure you addressed the following
requirements:

  • All commits in this PR have Signed-Off-By trailers (with
    git commit -s), and the commit message has max 60 characters for the
    summary and max 75 characters for each description line.
  • All added/changed functionality has a corresponding unit/integration
    test.
  • All added/changed public-facing functionality has entries in the "Upcoming
    Release" section of CHANGELOG.md (if no such section exists, please create one).
  • Any newly added unsafe code is properly documented.

ShadowCurse
ShadowCurse previously approved these changes Mar 10, 2025
roypat added 2 commits March 10, 2025 13:48
Construct an kvm_xsave2 with length set to 0. Useful when only a
kvm_xsave is at hand, but an API demands a kvm_xsave2, so the kvm_xsave
needs to converted into a Xsave with empty flexible array.

Signed-off-by: Patrick Roy <[email protected]>
The length of the FAM is not in bytes, but rather in terms of how many
__u32 elements are contained in the flexible array member. So clarify
the note that the return value of KVM_CHECK_EXTENSION not only needs to
subtract sizeof::<kvm_xsave>(), it also needs to divide by 4.

Signed-off-by: Patrick Roy <[email protected]>
@roypat roypat requested a review from rbradford March 11, 2025 15:08
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.

3 participants