hypervisor: Add MSHV implementation of VcpuInit
Extend the VcpuInit interface to accomodate changes for MSHV on aarch64. Signed-off-by: Jinank Jain <jinankjain@microsoft.com>
This commit is contained in:
parent
630f5c1f14
commit
8c796e6d5d
2 changed files with 21 additions and 0 deletions
|
|
@ -200,6 +200,8 @@ pub enum IrqRoutingEntry {
|
|||
pub enum VcpuInit {
|
||||
#[cfg(all(feature = "kvm", target_arch = "aarch64"))]
|
||||
Kvm(kvm_bindings::kvm_vcpu_init),
|
||||
#[cfg(all(feature = "mshv", target_arch = "aarch64"))]
|
||||
Mshv(mshv_bindings::MshvVcpuInit),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
|
|
|
|||
|
|
@ -210,6 +210,25 @@ impl From<crate::RegList> for mshv_bindings::MshvRegList {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
impl From<mshv_bindings::MshvVcpuInit> for crate::VcpuInit {
|
||||
fn from(s: mshv_bindings::MshvVcpuInit) -> Self {
|
||||
crate::VcpuInit::Mshv(s)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
impl From<crate::VcpuInit> for mshv_bindings::MshvVcpuInit {
|
||||
fn from(e: crate::VcpuInit) -> Self {
|
||||
match e {
|
||||
crate::VcpuInit::Mshv(e) => e,
|
||||
/* Needed in case other hypervisors are enabled */
|
||||
#[allow(unreachable_patterns)]
|
||||
_ => panic!("VcpuInit is not valid"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct MshvDirtyLogSlot {
|
||||
guest_pfn: u64,
|
||||
memory_size: u64,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue