Skip to main content

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::IsolationType;
10use crate::state::StateElement;
11use aarch64defs::Vendor;
12use inspect::Inspect;
13use mesh_protobuf::Protobuf;
14use thiserror::Error;
15use vm_topology::processor::aarch64::Aarch64VpInfo;
16
17/// VP state that can be set for initial boot.
18#[derive(Debug, PartialEq, Eq, Protobuf)]
19pub struct Aarch64InitialRegs {
20    /// Register state to be set on the BSP.
21    pub registers: vp::Registers,
22    /// System register state for the BSP.
23    pub system_registers: vp::SystemRegisters,
24}
25
26impl Aarch64InitialRegs {
27    pub fn at_reset(caps: &Aarch64PartitionCapabilities, bsp: &Aarch64VpInfo) -> Self {
28        Self {
29            registers: vp::Registers::at_reset(caps, bsp),
30            system_registers: vp::SystemRegisters::at_reset(caps, bsp),
31        }
32    }
33}
34
35#[derive(Debug, Inspect)]
36pub struct Aarch64PartitionCapabilities {
37    /// Isolation type for the partition.
38    pub isolation: IsolationType,
39    /// Whether the processor supports aarch32 execution at EL0.
40    pub supports_aarch32_el0: bool,
41    #[inspect(display)]
42    pub vendor: Vendor,
43}
44
45#[derive(Error, Debug)]
46pub enum Aarch64PartitionCapabilitiesError {}