mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-21 20:15:21 +00:00
vmm: AArch64: add methods to get saved vCPU states
The construction of `GICR_TYPER` register will need vCPU states. Therefore this commit adds methods to extract saved vCPU states from the cpu manager. Signed-off-by: Henry Wang <Henry.Wang@arm.com>
This commit is contained in:
parent
381d0b4372
commit
47e65cd341
@ -328,6 +328,12 @@ impl Vcpu {
|
||||
self.mpidr
|
||||
}
|
||||
|
||||
/// Gets the saved vCPU state.
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
pub fn get_saved_state(&self) -> Option<CpuState> {
|
||||
self.saved_state.clone()
|
||||
}
|
||||
|
||||
/// Runs the VCPU until it exits, returning the reason.
|
||||
///
|
||||
/// Note that the state of the VCPU and associated VM must be setup first for this to do
|
||||
@ -1041,6 +1047,14 @@ impl CpuManager {
|
||||
.collect()
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
pub fn get_saved_states(&self) -> Vec<CpuState> {
|
||||
self.vcpus
|
||||
.iter()
|
||||
.map(|cpu| cpu.lock().unwrap().get_saved_state().unwrap())
|
||||
.collect()
|
||||
}
|
||||
|
||||
#[cfg(feature = "acpi")]
|
||||
pub fn create_madt(&self) -> SDT {
|
||||
// This is also checked in the commandline parsing.
|
||||
|
Loading…
x
Reference in New Issue
Block a user