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:
Wei Liu
2022-07-14 15:17:07 +00:00
committed by Liu Wei
parent 02866fccb0
commit 9810ed4496
5 changed files with 56 additions and 21 deletions

View File

@@ -27,7 +27,6 @@ use crate::x86_64::{
use crate::CpuState;
#[cfg(target_arch = "aarch64")]
use crate::DeviceAttr;
#[cfg(feature = "kvm")]
use crate::MpState;
use thiserror::Error;
#[cfg(all(feature = "kvm", target_arch = "x86_64"))]
@@ -351,12 +350,10 @@ pub trait Vcpu: Send + Sync {
/// Setup the model-specific registers (MSR) for this vCPU.
///
fn set_msrs(&self, msrs: &MsrEntries) -> Result<usize>;
#[cfg(feature = "kvm")]
///
/// Returns the vcpu's current "multiprocessing state".
///
fn get_mp_state(&self) -> Result<MpState>;
#[cfg(feature = "kvm")]
///
/// Sets the vcpu's current "multiprocessing state".
///