@@ -21,6 +21,33 @@ The detailed design of the `vm-memory` crate can be found [here](DESIGN.md).
21
21
- Arch: x86, AMD64, ARM64
22
22
- OS: Linux/Unix/Windows
23
23
24
+ ### Xen support
25
+
26
+ Supporting Xen requires special handling while mapping the guest memory and
27
+ hence a separate feature is provided in the crate: ` xen ` . Mapping the guest
28
+ memory for Xen requires an ` ioctl() ` to be issued along with ` mmap() ` for the
29
+ memory area. The arguments for the ` ioctl() ` are received via the ` vhost-user `
30
+ protocol's memory region area.
31
+
32
+ Xen allows two different mapping models: ` Foreign ` and ` Grant ` .
33
+
34
+ In ` Foreign ` mapping model, the entire guest address space is mapped at once, in
35
+ advance. In ` Grant ` mapping model, the memory for few regions, like those
36
+ representing the virtqueues, is mapped in advance. The rest of the memory
37
+ regions are mapped (partially) only while accessing the buffers and the same is
38
+ immediately deallocated after the buffer is accessed. Hence, special handling
39
+ for the same in ` VolatileMemory.rs ` .
40
+
41
+ In order to still support standard Unix memory regions, for special regions and
42
+ testing, the Xen specific implementation here allows a third mapping type:
43
+ ` MmapXenFlags::UNIX ` . This performs standard Unix memory mapping and the same is
44
+ used for all tests in this crate.
45
+
46
+ It was decided by the ` rust-vmm ` maintainers to keep the interface simple and
47
+ build the crate for either standard Unix memory mapping or Xen, and not both.
48
+
49
+ Xen is only supported for Unix platforms.
50
+
24
51
## Usage
25
52
26
53
Add ` vm-memory ` as a dependency in ` Cargo.toml `
0 commit comments