-
Notifications
You must be signed in to change notification settings - Fork 107
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
feat(aarch64): generic get/set_one_reg #223
Conversation
941756d
to
c866df4
Compare
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.
To me this looks future proof and safe, meaning we won't run into weird issues with too-wide ARM registers again.
It should definitely get a CHANGELOG entry, since its a breaking change, though. Also, I'm not 100% sure the to_le_bytes
in the tests work for big endian architectures that rust-vmm formally supports. Someone with more experience there should give that a look over.
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.
Lgtm
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.
LGTM, but needs more testing.
Linux kernel defines arm registers up to 2048 bits wide. To support all different sized registers we change get/set_one_reg methods to accept a byte slice. For `set_one_reg` slice contains register data to be written to vcpu. For `get_one_reg` slice will have register data read from vcpu. Signed-off-by: Egor Lazarchuk <[email protected]>
5bbd85b
Signed-off-by: Egor Lazarchuk <[email protected]>
This patch bumps the following crates, including `[email protected]`*, `[email protected]`**, `[email protected]`, `[email protected]`, `[email protected]`***, `[email protected]`, `[email protected]`, `[email protected]`, `[email protected]`, `[email protected]`, and the latest of `vfio-bindings`, `vfio-ioctls`, `mshv-bindings`,`mshv-ioctls`, and `vfio-user`. * A fork of the `kvm-bindings` crate is being used to support serialization of various structs for migration [1]. Also, code changes are made to accommodate the updated `struct xsave` from the Linux kernel. Note: these changes related to `struct xsave` break live-upgrade. ** The new `kvm-ioctls` crate introduced breaking changes for the `get/set_one_reg` API on `aarch64` [2], so code changes are made to the new APIs. *** A fork of the `versionize_derive` crate is being used to support versionize on packed structs [3]. [1] https://github.com/cloud-hypervisor/kvm-bindings/tree/ch-v0.7.0 [2] rust-vmm/kvm#223 [3] https://github.com/cloud-hypervisor/versionize_derive/tree/ch-0.1.6 Fixes: cloud-hypervisor#6072 Signed-off-by: Bo Chen <[email protected]>
This patch bumps the following crates, including `[email protected]`*, `[email protected]`**, `[email protected]`, `[email protected]`, `[email protected]`***, `[email protected]`, `[email protected]`, `[email protected]`, `[email protected]`, `[email protected]`, and the latest of `vfio-bindings`, `vfio-ioctls`, `mshv-bindings`,`mshv-ioctls`, and `vfio-user`. * A fork of the `kvm-bindings` crate is being used to support serialization of various structs for migration [1]. Also, code changes are made to accommodate the updated `struct xsave` from the Linux kernel. Note: these changes related to `struct xsave` break live-upgrade. ** The new `kvm-ioctls` crate introduced breaking changes for the `get/set_one_reg` API on `aarch64` [2], so code changes are made to the new APIs. *** A fork of the `versionize_derive` crate is being used to support versionize on packed structs [3]. [1] https://github.com/cloud-hypervisor/kvm-bindings/tree/ch-v0.7.0 [2] rust-vmm/kvm#223 [3] https://github.com/cloud-hypervisor/versionize_derive/tree/ch-0.1.6 Fixes: #6072 Signed-off-by: Bo Chen <[email protected]>
This patch bumps the following crates, including `[email protected]`*, `[email protected]`**, `[email protected]`, `[email protected]`, `[email protected]`***, `[email protected]`, `[email protected]`, `[email protected]`, `[email protected]`, `[email protected]`, and the latest of `vfio-bindings`, `vfio-ioctls`, `mshv-bindings`,`mshv-ioctls`, and `vfio-user`. * A fork of the `kvm-bindings` crate is being used to support serialization of various structs for migration [1]. Also, code changes are made to accommodate the updated `struct xsave` from the Linux kernel. Note: these changes related to `struct xsave` break live-upgrade. ** The new `kvm-ioctls` crate introduced breaking changes for the `get/set_one_reg` API on `aarch64` [2], so code changes are made to the new APIs. *** A fork of the `versionize_derive` crate is being used to support versionize on packed structs [3]. [1] https://github.com/cloud-hypervisor/kvm-bindings/tree/ch-v0.7.0 [2] rust-vmm/kvm#223 [3] https://github.com/cloud-hypervisor/versionize_derive/tree/ch-0.1.6 Fixes: cloud-hypervisor#6072 Signed-off-by: Bo Chen <[email protected]> (cherry picked from commit 3ce0fef)
This patch bumps the following crates, including `[email protected]`*, `[email protected]`**, `[email protected]`, `[email protected]`, `[email protected]`***, `[email protected]`, `[email protected]`, `[email protected]`, `[email protected]`, `[email protected]`, and the latest of `vfio-bindings`, `vfio-ioctls`, `mshv-bindings`,`mshv-ioctls`, and `vfio-user`. * A fork of the `kvm-bindings` crate is being used to support serialization of various structs for migration [1]. Also, code changes are made to accommodate the updated `struct xsave` from the Linux kernel. Note: these changes related to `struct xsave` break live-upgrade. ** The new `kvm-ioctls` crate introduced breaking changes for the `get/set_one_reg` API on `aarch64` [2], so code changes are made to the new APIs. *** A fork of the `versionize_derive` crate is being used to support versionize on packed structs [3]. [1] https://github.com/cloud-hypervisor/kvm-bindings/tree/ch-v0.7.0 [2] rust-vmm/kvm#223 [3] https://github.com/cloud-hypervisor/versionize_derive/tree/ch-0.1.6 Fixes: #6072 Signed-off-by: Bo Chen <[email protected]> (cherry picked from commit 3ce0fef)
This patch bumps the following crates, including `[email protected]`*, `[email protected]`**, `[email protected]`, `[email protected]`, `[email protected]`***, `[email protected]`, `[email protected]`, `[email protected]`, `[email protected]`, `[email protected]`, and the latest of `vfio-bindings`, `vfio-ioctls`, `mshv-bindings`,`mshv-ioctls`, and `vfio-user`. * A fork of the `kvm-bindings` crate is being used to support serialization of various structs for migration [1]. Also, code changes are made to accommodate the updated `struct xsave` from the Linux kernel. Note: these changes related to `struct xsave` break live-upgrade. ** The new `kvm-ioctls` crate introduced breaking changes for the `get/set_one_reg` API on `aarch64` [2], so code changes are made to the new APIs. *** A fork of the `versionize_derive` crate is being used to support versionize on packed structs [3]. [1] https://github.com/cloud-hypervisor/kvm-bindings/tree/ch-v0.7.0 [2] rust-vmm/kvm#223 [3] https://github.com/cloud-hypervisor/versionize_derive/tree/ch-0.1.6 Fixes: #6072 Signed-off-by: Bo Chen <[email protected]> (cherry picked from commit 3ce0fef)
This patch bumps the following crates, including `[email protected]`*, `[email protected]`**, `[email protected]`, `[email protected]`, `[email protected]`***, `[email protected]`, `[email protected]`, `[email protected]`, `[email protected]`, `[email protected]`, and the latest of `vfio-bindings`, `vfio-ioctls`, `mshv-bindings`,`mshv-ioctls`, and `vfio-user`. * A fork of the `kvm-bindings` crate is being used to support serialization of various structs for migration [1]. Also, code changes are made to accommodate the updated `struct xsave` from the Linux kernel. Note: these changes related to `struct xsave` break live-upgrade. ** The new `kvm-ioctls` crate introduced breaking changes for the `get/set_one_reg` API on `aarch64` [2], so code changes are made to the new APIs. *** A fork of the `versionize_derive` crate is being used to support versionize on packed structs [3]. [1] https://github.com/cloud-hypervisor/kvm-bindings/tree/ch-v0.7.0 [2] rust-vmm/kvm#223 [3] https://github.com/cloud-hypervisor/versionize_derive/tree/ch-0.1.6 Fixes: #6072 Signed-off-by: Bo Chen <[email protected]> (cherry picked from commit 3ce0fef)
This patch bumps the following crates, including `[email protected]`*, `[email protected]`**, `[email protected]`, `[email protected]`, `[email protected]`***, `[email protected]`, `[email protected]`, `[email protected]`, `[email protected]`, `[email protected]`, and the latest of `vfio-bindings`, `vfio-ioctls`, `mshv-bindings`,`mshv-ioctls`, and `vfio-user`. * A fork of the `kvm-bindings` crate is being used to support serialization of various structs for migration [1]. Also, code changes are made to accommodate the updated `struct xsave` from the Linux kernel. Note: these changes related to `struct xsave` break live-upgrade. ** The new `kvm-ioctls` crate introduced breaking changes for the `get/set_one_reg` API on `aarch64` [2], so code changes are made to the new APIs. *** A fork of the `versionize_derive` crate is being used to support versionize on packed structs [3]. [1] https://github.com/cloud-hypervisor/kvm-bindings/tree/ch-v0.7.0 [2] rust-vmm/kvm#223 [3] https://github.com/cloud-hypervisor/versionize_derive/tree/ch-0.1.6 Fixes: #6072 Signed-off-by: Bo Chen <[email protected]> (cherry picked from commit 3ce0fef)
Summary of the PR
Linux kernel defines arm registers up to 2048 bits wide. To support all different sized the PR changes
get/set_one_reg
methods to accept a byte slice that either contains register data or will have register data be written to.Requirements
Before submitting your PR, please make sure you addressed the following
requirements:
git commit -s
), and the commitmessage has max 60 characters for the summary 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.