Add support for bus lock detection (KVM_CAP_X86_BUS_LOCK_EXIT).#245
Draft
00xc wants to merge 2 commits intorust-vmm:mainfrom
Draft
Add support for bus lock detection (KVM_CAP_X86_BUS_LOCK_EXIT).#24500xc wants to merge 2 commits intorust-vmm:mainfrom
KVM_CAP_X86_BUS_LOCK_EXIT).#24500xc wants to merge 2 commits intorust-vmm:mainfrom
Conversation
7f88ef8 to
4d98d7e
Compare
|
@00xc Can you please resolve the merge conflicts, after this LGTM. |
Introduce a new method to get an immutable reference to the kvm_run struct. Replace uses of `as_mut_ref()` with `as_ref()` where possible. Signed-off-by: Carlos López <carlos.lopez@suse.com>
Add support for bus lock detection. The feature can be enabled via KVM_CAP_X86_BUS_LOCK_EXIT, which enables a new exit (KVM_EXIT_X86_BUS_LOCK) and a new flag (KVM_RUN_X86_BUS_LOCK) in the kvm_run->flags field. Add two tests as well to verify that enabling the feature works. Signed-off-by: Carlos López <carlos.lopez@suse.com>
Contributor
Author
|
Rebased on main and fixed conflicts. |
lauralt
reviewed
Dec 15, 2023
| args: [args as u64, 0, 0, 0], | ||
| ..Default::default() | ||
| }; | ||
| vm.enable_cap(&cap).unwrap_err(); |
Collaborator
There was a problem hiding this comment.
Can we also check the inner error? Maybe using .errno() like in other tests.
| /// | ||
| /// See the API documentation for `KVM_CAP_X86_BUS_LOCK_EXIT`. | ||
| #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] | ||
| pub fn bus_lock_detected(&self) -> bool { |
Collaborator
There was a problem hiding this comment.
nit: I would prefix the name with is_ (is_bus_...) to match the naming conventions used for such functions.
Also, can we add a test for it?
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary of the PR
Add support for bus lock detection. The feature can be enabled via
KVM_CAP_X86_BUS_LOCK_EXIT, which enables a new exit (KVM_EXIT_X86_BUS_LOCK) and a new flag (KVM_RUN_X86_BUS_LOCK) in thekvm_run->flagsfield.Add two tests as well to verify that enabling the feature works
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).
unsafecode is properly documented.