1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

//! Client definitions for functionality in the `vmm_core` crate.

#![forbid(unsafe_code)]

pub mod debug_rpc;

use inspect::Inspect;
use mesh::payload::Protobuf;
use std::sync::Arc;

/// HaltReason sent by devices and vp_set to the vmm.
#[derive(Debug, Clone, Eq, PartialEq, Protobuf, Inspect)]
#[inspect(tag = "halt_reason")]
pub enum HaltReason {
    PowerOff,
    Reset,
    Hibernate,
    DebugBreak {
        #[inspect(rename = "failing_vp")]
        vp: Option<u32>,
    },
    TripleFault {
        #[inspect(rename = "failing_vp")]
        vp: u32,
        #[inspect(skip)]
        // Arc'ed for size and cheap clones.
        registers: Option<Arc<virt::vp::Registers>>,
    },
    InvalidVmState {
        #[inspect(rename = "failing_vp")]
        vp: u32,
    },
    VpError {
        #[inspect(rename = "failing_vp")]
        vp: u32,
    },
    SingleStep {
        #[inspect(rename = "failing_vp")]
        vp: u32,
    },
    HwBreakpoint {
        #[inspect(rename = "failing_vp")]
        vp: u32,
        #[inspect(skip)]
        breakpoint: virt::x86::HardwareBreakpoint,
    },
}