pub fn configure_aarch64(
        &mut self,
        vm_fd: &VmFd,
        guest_mem: &GuestMemoryMmap,
        kernel_load_addr: GuestAddress,
    ) -> Result<()> {
        let mut kvi: kvm_bindings::kvm_vcpu_init = kvm_bindings::kvm_vcpu_init::default();

        // This reads back the kernel's preferred target type.
        vm_fd
            .get_preferred_target(&mut kvi)
            .map_err(Error::VcpuArmPreferredTarget)?;
        // We already checked that the capability is supported.
        kvi.features[0] |= 1 << kvm_bindings::KVM_ARM_VCPU_PSCI_0_2;
        // Non-boot cpus are powered off initially.
        if self.id > 0 {
            kvi.features[0] |= 1 << kvm_bindings::KVM_ARM_VCPU_POWER_OFF;
        }

        self.fd.vcpu_init(&kvi).map_err(Error::VcpuArmInit)?;
        arch::aarch64::regs::setup_regs(&self.fd, self.id, kernel_load_addr.raw_value(), guest_mem)
            .map_err(Error::REGSConfiguration)?;

        self.mpidr = arch::aarch64::regs::read_mpidr(&self.fd).map_err(Error::REGSConfiguration)?;

        Ok(())
    }
/// Configures an aarch64 specific vcpu.
///
/// # Arguments
///
/// * `vm_fd` - The kvm `VmFd` for this microvm.
/// * `guest_mem` - The guest memory used by this microvm.
/// * `kernel_load_addr` - Offset from `guest_mem` at which the kernel is loaded.
Configures an aarch64 specific vcpu.
Configures an aarch64 specific vcpu .
pub fn configure_aarch64(
        &mut self,
        vm_fd: &VmFd,
        guest_mem: &GuestMemoryMmap,
        kernel_load_addr: GuestAddress,
    ) -> Result<()> {
        let mut kvi: kvm_bindings::kvm_vcpu_init = kvm_bindings::kvm_vcpu_init::default();
        // This reads back the kernel's preferred target type.
        vm_fd
            .get_preferred_target(&mut kvi)
            .map_err(Error::VcpuArmPreferredTarget)?;
        // We already checked that the capability is supported.
        kvi.features[0] |= 1 << kvm_bindings::KVM_ARM_VCPU_PSCI_0_2;
        // Non-boot cpus are powered off initially.
        if self.id > 0 {
            kvi.features[0] |= 1 << kvm_bindings::KVM_ARM_VCPU_POWER_OFF;
        }
        self.fd.vcpu_init(&kvi).map_err(Error::VcpuArmInit)?;
        arch::aarch64::regs::setup_regs(&self.fd, self.id, kernel_load_addr.raw_value(), guest_mem)
            .map_err(Error::REGSConfiguration)?;
        self.mpidr = arch::aarch64::regs::read_mpidr(&self.fd).map_err(Error::REGSConfiguration)?;
        Ok(())
    }
pub fn configure_aarch64 ( & mut self , vm_fd : & VmFd , guest_mem : & GuestMemoryMmap , kernel_load_addr : GuestAddress , ) -> Result < ( ) > { let mut kvi : kvm_bindings :: kvm_vcpu_init = kvm_bindings :: kvm_vcpu_init :: default ( ) ; // This reads back the kernel's preferred target type. vm_fd . get_preferred_target ( & mut kvi ) . map_err ( Error :: VcpuArmPreferredTarget ) ? ; // We already checked that the capability is supported. kvi . features [ 0 ] |= 1 << kvm_bindings :: KVM_ARM_VCPU_PSCI_0_2 ; // Non-boot cpus are powered off initially. if self . id > 0 { kvi . features [ 0 ] |= 1 << kvm_bindings :: KVM_ARM_VCPU_POWER_OFF ; } self . fd . vcpu_init ( & kvi ) . map_err ( Error :: VcpuArmInit ) ? ; arch :: aarch64 :: regs :: setup_regs ( & self . fd , self . id , kernel_load_addr . raw_value ( ) , guest_mem ) . map_err ( Error :: REGSConfiguration ) ? ; self . mpidr = arch :: aarch64 :: regs :: read_mpidr ( & self . fd ) . map_err ( Error :: REGSConfiguration ) ? ; Ok ( ( ) ) }
Configures an aarch64 specific vcpu.
Configures an aarch64 specific vcpu .
&mut self
vm_fd
&VmFd
guest_mem
&GuestMemoryMmap
kernel_load_addr
GuestAddress