diff --git a/hypervisor/src/hypervisor.rs b/hypervisor/src/hypervisor.rs index e883e1195..6fe5e8e79 100644 --- a/hypervisor/src/hypervisor.rs +++ b/hypervisor/src/hypervisor.rs @@ -100,4 +100,9 @@ pub trait Hypervisor: Send + Sync { /// Retrieve the list of MSRs supported by the hypervisor. /// fn get_msr_list(&self) -> Result; + #[cfg(target_arch = "aarch64")] + /// + /// Retrieve AArch64 host maximum IPA size supported by KVM. + /// + fn get_host_ipa_limit(&self) -> i32; } diff --git a/hypervisor/src/kvm/mod.rs b/hypervisor/src/kvm/mod.rs index 4a781939e..effa63e8c 100644 --- a/hypervisor/src/kvm/mod.rs +++ b/hypervisor/src/kvm/mod.rs @@ -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 {