mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +00:00
hypervisor: Introduce get_guest_debug_hw_bps()
Added `Hypervisor::get_guest_debug_hw_bps()` for fetching the number of supported hardware breakpoints. Signed-off-by: Michael Zhao <michael.zhao@arm.com>
This commit is contained in:
parent
3126b351c1
commit
223b1f6c51
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -472,7 +472,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "kvm-ioctls"
|
||||
version = "0.11.0"
|
||||
source = "git+https://github.com/rust-vmm/kvm-ioctls?branch=main#63f2f1231d49478197e15b8e9ff5d4e827aa288f"
|
||||
source = "git+https://github.com/rust-vmm/kvm-ioctls?branch=main#6705a619970fb0b2be47f1781f2ccf856cd5ce6a"
|
||||
dependencies = [
|
||||
"kvm-bindings",
|
||||
"libc",
|
||||
|
@ -117,7 +117,7 @@ pub trait Hypervisor: Send + Sync {
|
||||
}
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
///
|
||||
/// Retrieve AArch64 host maximum IPA size supported by KVM.
|
||||
/// Retrieve AArch64 host maximum IPA size supported by KVM
|
||||
///
|
||||
fn get_host_ipa_limit(&self) -> i32;
|
||||
///
|
||||
@ -125,4 +125,10 @@ pub trait Hypervisor: Send + Sync {
|
||||
///
|
||||
#[cfg(feature = "tdx")]
|
||||
fn tdx_capabilities(&self) -> Result<TdxCapabilities>;
|
||||
///
|
||||
/// Get the number of supported hardware breakpoints
|
||||
///
|
||||
fn get_guest_debug_hw_bps(&self) -> usize {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
@ -1076,6 +1076,20 @@ impl hypervisor::Hypervisor for KvmHypervisor {
|
||||
|
||||
Ok(data)
|
||||
}
|
||||
|
||||
///
|
||||
/// Get the number of supported hardware breakpoints
|
||||
///
|
||||
fn get_guest_debug_hw_bps(&self) -> usize {
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
{
|
||||
4
|
||||
}
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
{
|
||||
self.kvm.get_guest_debug_hw_bps() as usize
|
||||
}
|
||||
}
|
||||
}
|
||||
/// Vcpu struct for KVM
|
||||
pub struct KvmVcpu {
|
||||
|
Loading…
Reference in New Issue
Block a user