Commit 54ffc0d
authored
Gdb support for mshv guests (#327)
* dbg: change visibility of debugging related functions/structs
Signed-off-by: Doru Blânzeanu <[email protected]>
* dbg: move kvm vcpu debug type to another file
- this is done in preparation of accomodating support for other hypervisors
which means some of the functionality whould be common.
- moving the debug code to a separate file can enable us to
group common behavior in traits
Signed-off-by: Doru Blânzeanu <[email protected]>
* dbg: move hardware breakpoints functionality to separate file
- also add a trait that contains all the needed methods for interacting
with a vCPU
Signed-off-by: Doru Blânzeanu <[email protected]>
* dbg: move read/write registers and get_stop_reason to vCPU functionality trait
Signed-off-by: Doru Blânzeanu <[email protected]>
* dbg: modify hw breakpoints and move common functionality in trait
Signed-off-by: Doru Blânzeanu <[email protected]>
* dbg: move read/write address and add/remove sw breakpoint to separate file
- add trait to define common behavior to be used by other hypervisors
later
Signed-off-by: Doru Blânzeanu <[email protected]>
* dbg: remove specific method that adds entry point breakpoint
- it can be done using the generic way to add hw breakpoints
- also remove the entry point breakpoint after the vCPU stops to
avoid hanging there
Signed-off-by: Doru Blânzeanu <[email protected]>
* dbg: improve vCPU exit reason checking
- verify the debug registers that report what kind of exception was triggered
- in case there is an unknown reason, report it as a SwBp so that the gdb
client can inspect what happened
Signed-off-by: Doru Blânzeanu <[email protected]>
* dbg: prepare for mshv guest debugging implementation
Signed-off-by: Doru Blânzeanu <[email protected]>
* dbg: add basic skeleton for mshv guest debug
Signed-off-by: Doru Blânzeanu <[email protected]>
* dbg: add mshv intercepts for #DB and #BP exceptions
Signed-off-by: Doru Blânzeanu <[email protected]>
* dbg: mshv guest debugging support for vCPU operations
Signed-off-by: Doru Blânzeanu <[email protected]>
* dbg: mshv guest debugging support for memory inspection
Signed-off-by: Doru Blânzeanu <[email protected]>
* dbg: read/write addresses check offset calculation
- use checked_sub to avoid issues from addresses that could cause
underflow
Signed-off-by: Doru Blânzeanu <[email protected]>
* dbg: enable ci guest debugging tests on mshv
- change gdb commands in test to be usable with older gdb versions
- change Justfile to provide mshv3 feature
- change gdb test to invoke cargo test with correct features for mshv
Signed-off-by: Doru Blânzeanu <[email protected]>
* dbg: update documentation to specify the mshv debug support
Signed-off-by: Doru Blânzeanu <[email protected]>
* dbg: add specific logging for each debug command error encountered
Signed-off-by: Doru Blânzeanu <[email protected]>
---------
Signed-off-by: Doru Blânzeanu <[email protected]>1 parent 1ffacdf commit 54ffc0d
File tree
14 files changed
+1320
-520
lines changed- .github/workflows
- docs
- src/hyperlight_host
- examples/guest-debugging
- src/hypervisor
- gdb
14 files changed
+1320
-520
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
121 | | - | |
122 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
137 | 142 | | |
138 | 143 | | |
139 | 144 | | |
140 | 145 | | |
141 | 146 | | |
142 | | - | |
| 147 | + | |
143 | 148 | | |
144 | 149 | | |
145 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
60 | | - | |
| 61 | + | |
61 | 62 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
| 63 | + | |
| 64 | + | |
67 | 65 | | |
68 | 66 | | |
69 | 67 | | |
| |||
115 | 113 | | |
116 | 114 | | |
117 | 115 | | |
118 | | - | |
| 116 | + | |
119 | 117 | | |
120 | 118 | | |
121 | 119 | | |
| |||
0 commit comments