mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
hypervisor: provide a generic MpState structure
It is however only used for KVM right now because MSHV does not need it yet. Nonetheless a stub MSHV constructor should be there and get/set functions should be implemented for MSHV. Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
@@ -25,7 +25,8 @@ use vm::DataMatch;
|
||||
pub mod x86_64;
|
||||
use crate::device;
|
||||
use crate::{
|
||||
UserMemoryRegion, USER_MEMORY_REGION_EXECUTE, USER_MEMORY_REGION_READ, USER_MEMORY_REGION_WRITE,
|
||||
MpState, UserMemoryRegion, USER_MEMORY_REGION_EXECUTE, USER_MEMORY_REGION_READ,
|
||||
USER_MEMORY_REGION_WRITE,
|
||||
};
|
||||
use vmm_sys_util::eventfd::EventFd;
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
@@ -541,6 +542,18 @@ impl cpu::Vcpu for MshvVcpu {
|
||||
.set_lapic(lapic)
|
||||
.map_err(|e| cpu::HypervisorCpuError::SetLapicState(e.into()))
|
||||
}
|
||||
///
|
||||
/// Returns the vcpu's current "multiprocessing state".
|
||||
///
|
||||
fn get_mp_state(&self) -> cpu::Result<MpState> {
|
||||
Ok(MpState::Mshv)
|
||||
}
|
||||
///
|
||||
/// Sets the vcpu's current "multiprocessing state".
|
||||
///
|
||||
fn set_mp_state(&self, _mp_state: MpState) -> cpu::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
///
|
||||
/// X86 specific call that returns the vcpu's current "xsave struct".
|
||||
|
||||
@@ -66,8 +66,6 @@ impl fmt::Display for VcpuMshvState {
|
||||
}
|
||||
}
|
||||
|
||||
pub struct MpState {}
|
||||
|
||||
impl SegmentRegisterOps for SegmentRegister {
|
||||
fn segment_type(&self) -> u8 {
|
||||
self.type_
|
||||
|
||||
Reference in New Issue
Block a user