Commit bd7ee70
committed
add concept of "swiotlb regions" to
Add a special `GuestMemoryMmap` to `struct Vm` that has the semantics
that if its not empty, it represents the swiotlb area in the guest.
Have all virtio devices only get access to swiotlb regions if they
exist, only falling back onto having access to all of guest memory
otherwise. This means that in case of swiotlb regions being set up,
virtio devices cannot access generic memory, so if the guest decides to
(incorrectly) place I/O buffers outside of swiotlb we'll get a somewhat
meaningful error of "invalid guest address" (or similar), instead of
random things failing further down the line in case generic memory isn't
accessible by firecracker/the host kernel for some reason (e.g. if its
guest_memfd backed in the future).
When a VM with swiotlb regions is being snapshotted, the regions are
simply concatenated to the end of the snapshot memory file. This changes
the snapshot memory file format in the sense that regions in the file
are not necessarily sorted by guest address anymore.
Signed-off-by: Patrick Roy <[email protected]>struct Vm
1 parent d6c88a3 commit bd7ee70
File tree
6 files changed
+74
-20
lines changed- src/vmm/src
- arch
- aarch64
- x86_64
- vstate
6 files changed
+74
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| 100 | + | |
| 101 | + | |
99 | 102 | | |
100 | 103 | | |
101 | 104 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
190 | 191 | | |
191 | 192 | | |
192 | 193 | | |
| |||
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
| 215 | + | |
| 216 | + | |
214 | 217 | | |
215 | 218 | | |
216 | 219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
| |||
64 | 62 | | |
65 | 63 | | |
66 | 64 | | |
67 | | - | |
68 | 65 | | |
69 | 66 | | |
70 | 67 | | |
| |||
648 | 645 | | |
649 | 646 | | |
650 | 647 | | |
651 | | - | |
| 648 | + | |
652 | 649 | | |
653 | 650 | | |
654 | 651 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
700 | 700 | | |
701 | 701 | | |
702 | 702 | | |
703 | | - | |
| 703 | + | |
704 | 704 | | |
705 | 705 | | |
706 | 706 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| 38 | + | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| 107 | + | |
106 | 108 | | |
107 | 109 | | |
108 | 110 | | |
| |||
142 | 144 | | |
143 | 145 | | |
144 | 146 | | |
| 147 | + | |
| 148 | + | |
145 | 149 | | |
146 | 150 | | |
147 | 151 | | |
| |||
177 | 181 | | |
178 | 182 | | |
179 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
180 | 198 | | |
181 | 199 | | |
182 | 200 | | |
183 | 201 | | |
184 | 202 | | |
185 | | - | |
| 203 | + | |
| 204 | + | |
186 | 205 | | |
187 | 206 | | |
188 | 207 | | |
189 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
190 | 234 | | |
191 | 235 | | |
192 | 236 | | |
| |||
203 | 247 | | |
204 | 248 | | |
205 | 249 | | |
206 | | - | |
207 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
208 | 255 | | |
209 | | - | |
210 | | - | |
| 256 | + | |
| 257 | + | |
211 | 258 | | |
212 | 259 | | |
213 | 260 | | |
214 | 261 | | |
215 | | - | |
| 262 | + | |
216 | 263 | | |
217 | 264 | | |
218 | 265 | | |
219 | 266 | | |
220 | 267 | | |
221 | 268 | | |
222 | 269 | | |
223 | | - | |
| 270 | + | |
224 | 271 | | |
225 | 272 | | |
226 | 273 | | |
| |||
230 | 277 | | |
231 | 278 | | |
232 | 279 | | |
233 | | - | |
| 280 | + | |
234 | 281 | | |
235 | 282 | | |
236 | 283 | | |
| |||
293 | 340 | | |
294 | 341 | | |
295 | 342 | | |
296 | | - | |
| 343 | + | |
297 | 344 | | |
298 | 345 | | |
299 | | - | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
300 | 350 | | |
301 | 351 | | |
302 | 352 | | |
303 | 353 | | |
304 | 354 | | |
305 | 355 | | |
306 | 356 | | |
307 | | - | |
| 357 | + | |
| 358 | + | |
308 | 359 | | |
309 | 360 | | |
310 | 361 | | |
| |||
0 commit comments