hypervisor: Implement StandardRegisters as union of KVM & MSHV

Currently we are redefining StandardRegisters instead of using the ones
coming from bindings. With this we can remove the unnecessary
construction of global structure which contains fields from different
hypervisor dependent structs.

Signed-off-by: Jinank Jain <jinankjain@microsoft.com>
This commit is contained in:
Jinank Jain
2024-08-01 12:00:59 +00:00
committed by Bo Chen
parent 3645654c39
commit feb0a36067
3 changed files with 42 additions and 0 deletions

View File

@@ -187,3 +187,11 @@ pub enum IrqRoutingEntry {
#[cfg(feature = "mshv")]
Mshv(mshv_bindings::mshv_msi_routing_entry),
}
#[derive(Debug, Clone, Copy, PartialEq, serde::Serialize, serde::Deserialize)]
pub enum StandardRegisters {
#[cfg(feature = "kvm")]
Kvm(kvm_bindings::kvm_regs),
#[cfg(all(feature = "mshv", target_arch = "x86_64"))]
Mshv(mshv_bindings::StandardRegisters),
}