-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Addition of kvm_capabilities and vcpu_features to custom CPU templates #3967
Merged
ShadowCurse
merged 12 commits into
firecracker-microvm:main
from
ShadowCurse:kvm_and_vcpu_config
Aug 21, 2023
Merged
Addition of kvm_capabilities and vcpu_features to custom CPU templates #3967
ShadowCurse
merged 12 commits into
firecracker-microvm:main
from
ShadowCurse:kvm_and_vcpu_config
Aug 21, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e706260
to
4860e1e
Compare
3b463b3
to
3c5cfdd
Compare
zulinx86
reviewed
Aug 21, 2023
tests/integration_tests/functional/test_cpu_features_aarch64.py
Outdated
Show resolved
Hide resolved
44ecaf1
to
140a532
Compare
zulinx86
previously approved these changes
Aug 21, 2023
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.
Let me say thank you again for your effort on organizing commits! LGTM!
da6cb39
to
0ce4f90
Compare
zulinx86
approved these changes
Aug 21, 2023
Moved all code from `KvmContext` into `Vmm::new`. This simplifies code, because before both struct were always used together. Also removed `setup_kvm_vm` method, because it is too short now. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Added `vcpu_features` field to the cpu templates for aarch64. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Removed incorrectly placed commas from json strings in the tests. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Removed `init_vcpu` helper method from aarch64 vcpu tests. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
- `vcpu.init` is moved out of `create_vcpus` method. - `vcpu`s states are now restored before `vcpu`s are put into separate threads. This in turn removed the need for `VcpuEvent::RestoreState` `VcpuResponce::RestoreState` and `restore_vcpu_states` method. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Added `vcpu_features` parameter to `vcpu.init`. This parameter will be used in the next commit to modify enabled vcpu features. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Added `kvi` to the vcpu state on aarch64 to keep track of enabled vcpu features that could be modified with cpu templates. This required updates of `kvm-bindings` and `kvm-ioctls` dependencies. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Added new snapshot version check to prevent creation of snapshots with version less than 1.5 if `vcpu_features` field is used in provided cpu template. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Added `KvmCapabilities` to the cpu templates for both x86_64 and aarch64. This allows users to add or remove KVM capabilities check that FC is performing. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
If cpu template uses `vcpu_features` or `kvm_capabilities` fields then minimal snap version that can be created is 1.5. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
Added integration test for `vcpu_features` and `kvm_capabilities` fields in cpu templates. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
- Added new `kvm_capabilities` and `vcpu_features` fields descriptions to the `schema.json` - Updated `cpu-templates.md` - Updated `CHANGELOG.md` Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
0ce4f90
to
3eacc79
Compare
kalyazin
approved these changes
Aug 21, 2023
zulinx86
added a commit
to zulinx86/firecracker
that referenced
this pull request
Sep 13, 2023
Changes on guest CPU config are as follows: - CPUID.0x7:EBX - ERMS (bit 9) on AMD (marked as reserved in APM) - CPUID.0x7:EDX - FSRM (bit 4) on AMD + kernel 5.10 and 6.10 (marked as reserved in APM) - IA32_ARCH_CAPABILITIES MSR (index: 0x10A) - GDS_CTRL (bit 25) on Intel + kernel 4.14 - GDS_NO (bit 26) on Intel kvm_capabilities and vcpu_features fields were added in PR firecracker-microvm#3967. Signed-off-by: Takahiro Itazuri <itazur@amazon.com>
4 tasks
wearyzen
pushed a commit
to zulinx86/firecracker
that referenced
this pull request
Sep 14, 2023
Changes on guest CPU config are as follows: - CPUID.0x7:EBX - ERMS (bit 9) on AMD (marked as reserved in APM) - CPUID.0x7:EDX - FSRM (bit 4) on AMD + kernel 5.10 and 6.10 (marked as reserved in APM) - IA32_ARCH_CAPABILITIES MSR (index: 0x10A) - GDS_CTRL (bit 25) on Intel + kernel 4.14 - GDS_NO (bit 26) on Intel kvm_capabilities and vcpu_features fields were added in PR firecracker-microvm#3967. Signed-off-by: Takahiro Itazuri <itazur@amazon.com>
wearyzen
pushed a commit
that referenced
this pull request
Sep 14, 2023
Changes on guest CPU config are as follows: - CPUID.0x7:EBX - ERMS (bit 9) on AMD (marked as reserved in APM) - CPUID.0x7:EDX - FSRM (bit 4) on AMD + kernel 5.10 and 6.10 (marked as reserved in APM) - IA32_ARCH_CAPABILITIES MSR (index: 0x10A) - GDS_CTRL (bit 25) on Intel + kernel 4.14 - GDS_NO (bit 26) on Intel kvm_capabilities and vcpu_features fields were added in PR #3967. Signed-off-by: Takahiro Itazuri <itazur@amazon.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Status: Awaiting review
Indicates that a pull request is ready to be reviewed
Type: Enhancement
Indicates new feature requests
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Main changes are additions of couple fields to the cpu templates:
kvm_capabilities
field.vcpu_features
fieldReason
KVM capabilities:
vcpu_features
. For x86_64 there was an issue that FC did not boot on old cpu, because some KVM feature was not available there, even though it was only used for snapshots.VCPU features(aarch64 only):
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following
Developer Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md
.PR Checklist
CHANGELOG.md
.TODO
s link to an issue.rust-vmm
.