virt/aarch64/
mod.rs

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4pub mod gic_software_device;
5pub mod gic_v2m;
6pub mod vm;
7pub mod vp;
8
9use crate::state::StateElement;
10use inspect::Inspect;
11use mesh_protobuf::Protobuf;
12use thiserror::Error;
13use vm_topology::processor::aarch64::Aarch64VpInfo;
14
15/// VP state that can be set for initial boot.
16#[derive(Debug, PartialEq, Eq, Protobuf)]
17pub struct Aarch64InitialRegs {
18    /// Register state to be set on the BSP.
19    pub registers: vp::Registers,
20    /// System register state for the BSP.
21    pub system_registers: vp::SystemRegisters,
22}
23
24impl Aarch64InitialRegs {
25    pub fn at_reset(caps: &Aarch64PartitionCapabilities, bsp: &Aarch64VpInfo) -> Self {
26        Self {
27            registers: vp::Registers::at_reset(caps, bsp),
28            system_registers: vp::SystemRegisters::at_reset(caps, bsp),
29        }
30    }
31}
32
33#[derive(Debug, Inspect)]
34pub struct Aarch64PartitionCapabilities {
35    /// Whether the processor supports aarch32 execution at EL0.
36    pub supports_aarch32_el0: bool,
37}
38
39#[derive(Error, Debug)]
40pub enum Aarch64PartitionCapabilitiesError {}