You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lots of virtio code first converts descriptor chains to Vec<VolatileSlice>, and then later converts that into Vec<iovec> for use with readv/ writev, which has a nasty intermediate allocation of a vector. Firecracker works around this problem by going straight to Vec<iovec>, and then loosing all the safety of the VolatileSlice abstractions, which is also not great. For that reason, we'd like to slim down VolatileSlice to get rid of all metadata, so just the pointer and length fields remain.
The dirty bitmap tracking: Potentially, this can be done via a decorator instead
The Xen-only MmapInfo: This can be removed by re-framing Xen memory as an IoMemory implementation (instead of GuestMemory), as defined in I/O virtual memory (IOMMU) support #327 (the xen stuff is in VolatileSlice because in the past, that was the only place where we definitely know whether an access is a read or a write, but with IoMemory, we will have permission information way further up the stack, and can do all the Xen ioctls/mmap calls prior to VolatileSlice creation)
Lots of virtio code first converts descriptor chains to
Vec<VolatileSlice>, and then later converts that intoVec<iovec>for use withreadv/writev, which has a nasty intermediate allocation of a vector. Firecracker works around this problem by going straight toVec<iovec>, and then loosing all the safety of theVolatileSliceabstractions, which is also not great. For that reason, we'd like to slim downVolatileSliceto get rid of all metadata, so just the pointer and length fields remain.Currently, VolatileSlice is defined as follows:
vm-memory/src/volatile_memory.rs
Lines 393 to 398 in 3854f01
So what we need to move out is
IoMemoryimplementation (instead ofGuestMemory), as defined in I/O virtual memory (IOMMU) support #327 (the xen stuff is in VolatileSlice because in the past, that was the only place where we definitely know whether an access is a read or a write, but with IoMemory, we will have permission information way further up the stack, and can do all the Xen ioctls/mmap calls prior to VolatileSlice creation)