MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / configure_vcpu

Function configure_vcpu

arch/src/aarch64/mod.rs:68–84  ·  view source on GitHub ↗

Configure the specified VCPU, and return its MPIDR.

(
    vcpu: &dyn hypervisor::Vcpu,
    id: u32,
    boot_setup: Option<(EntryPoint, &GuestMemoryAtomic<GuestMemoryMmap>)>,
)

Source from the content-addressed store, hash-verified

66
67/// Configure the specified VCPU, and return its MPIDR.
68pub fn configure_vcpu(
69 vcpu: &dyn hypervisor::Vcpu,
70 id: u32,
71 boot_setup: Option<(EntryPoint, &GuestMemoryAtomic<GuestMemoryMmap>)>,
72) -> super::Result<u64> {
73 if let Some((kernel_entry_point, _guest_memory)) = boot_setup {
74 vcpu.setup_regs(
75 id,
76 kernel_entry_point.entry_addr.raw_value(),
77 super::layout::FDT_START.raw_value(),
78 )
79 .map_err(Error::RegsConfiguration)?;
80 }
81
82 let mpidr = vcpu.get_sys_reg(MPIDR_EL1).map_err(Error::VcpuRegMpidr)?;
83 Ok(mpidr)
84}
85
86pub fn arch_memory_regions() -> Vec<(GuestAddress, usize, RegionType)> {
87 vec![

Callers

nothing calls this directly

Calls 2

setup_regsMethod · 0.45
get_sys_regMethod · 0.45

Tested by

no test coverage detected