-
Notifications
You must be signed in to change notification settings - Fork 109
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
Add support for bus lock detection (KVM_CAP_X86_BUS_LOCK_EXIT
).
#245
base: main
Are you sure you want to change the base?
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 <[email protected]>
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 <[email protected]>
Rebased on main and fixed conflicts. |
args: [args as u64, 0, 0, 0], | ||
..Default::default() | ||
}; | ||
vm.enable_cap(&cap).unwrap_err(); |
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.
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 { |
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.
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?
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->flags
field.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).
unsafe
code is properly documented.