mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-30 16:35:31 +00:00
hypervisor: Add get_host_ipa_limit
for AArch64
This commit adds a helper `get_host_ipa_limit` to the AArch64 `KvmHypervisor` struct. This helper can be used to get the `Host_IPA_Limit`, which is the maximum possible value for IPA_Bits on the host and is dependent on the CPU capability and the kernel configuration. Signed-off-by: Henry Wang <Henry.Wang@arm.com>
This commit is contained in:
parent
97307a7fc1
commit
805cb303d5
@ -100,4 +100,9 @@ pub trait Hypervisor: Send + Sync {
|
||||
/// Retrieve the list of MSRs supported by the hypervisor.
|
||||
///
|
||||
fn get_msr_list(&self) -> Result<MsrList>;
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
///
|
||||
/// Retrieve AArch64 host maximum IPA size supported by KVM.
|
||||
///
|
||||
fn get_host_ipa_limit(&self) -> i32;
|
||||
}
|
||||
|
@ -584,6 +584,13 @@ impl hypervisor::Hypervisor for KvmHypervisor {
|
||||
.get_msr_index_list()
|
||||
.map_err(|e| hypervisor::HypervisorError::GetMsrList(e.into()))
|
||||
}
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
///
|
||||
/// Retrieve AArch64 host maximum IPA size supported by KVM.
|
||||
///
|
||||
fn get_host_ipa_limit(&self) -> i32 {
|
||||
self.kvm.get_host_ipa_limit()
|
||||
}
|
||||
}
|
||||
/// Vcpu struct for KVM
|
||||
pub struct KvmVcpu {
|
||||
|
Loading…
x
Reference in New Issue
Block a user