krata icon indicating copy to clipboard operation
krata copied to clipboard

feature: filesystem mount support

Open azenla opened this issue 1 year ago • 5 comments

There are multiple branches already associated with filesystem mounts, but this issue is to track the official implementation that is performant and secure.

Prior art is https://github.com/azenla/krata/tree/mount and https://github.com/azenla/krata/tree/sandbox, however it might be interesting to look into virtiofs too via rust-vmm. rust-vmm uses standard C rust bindings which we have, by policy, krata does not use. Therefore, we would need to fork rust-vmm and eventually upstream pure Rust bindings.

azenla avatar Jul 26 '24 20:07 azenla

Hello @DemiMarie, when we last spoke you mentioned that virtiofs was a better choice, rather than the Xen 9pfs protocol specification. Do you have any thoughts on that you can share? rust-vmm is very interesting for us but to implement virtio with rust-vmm we would need to bring in our own xengnt and associated bindings for vm-memory to avoid pulling in C bindings. We've already started implementing the xen 9p protocol specification in a branch, but if virtiofs has specific advantages you can think of, we'd love to hear them!

Thanks in advance!

azenla avatar Jul 26 '24 20:07 azenla

Hello @DemiMarie, when we last spoke you mentioned that virtiofs was a better choice, rather than the Xen 9pfs protocol specification. Do you have any thoughts on that you can share? rust-vmm is very interesting for us but to implement virtio with rust-vmm we would need to bring in our own xengnt and associated bindings for vm-memory to avoid pulling in C bindings. We've already started implementing the xen 9p protocol specification in a branch, but if virtiofs has specific advantages you can think of, we'd love to hear them!

Thanks in advance!

virtiofs is a local filesystem, not a network filesystem. It is 100% POSIX-complient (network filesystems usually aren’t) and is based on FUSE with the FUSE server running on the host. With DAX (currently broken but fixable) it is possible to have full cache coherency between guest and host and even between other guests.

virtiofs is used in production in macOS and ChromeOS and massively improved performance on Docker Desktop.

DemiMarie avatar Jul 30 '24 20:07 DemiMarie

One feature that may need to be added to Xen is Linux kernel MMU notifier support. This will happen because AMD needs it for virtio-GPU native contexts, which they will be shipping in a commercial product for the automotive market.

DemiMarie avatar Jul 30 '24 20:07 DemiMarie

Hello @DemiMarie, when we last spoke you mentioned that virtiofs was a better choice, rather than the Xen 9pfs protocol specification. Do you have any thoughts on that you can share? rust-vmm is very interesting for us but to implement virtio with rust-vmm we would need to bring in our own xengnt and associated bindings for vm-memory to avoid pulling in C bindings. We've already started implementing the xen 9p protocol specification in a branch, but if virtiofs has specific advantages you can think of, we'd love to hear them! Thanks in advance!

virtiofs is a local filesystem, not a network filesystem. It is 100% POSIX-complient (network filesystems usually aren’t) and is based on FUSE with the FUSE server running on the host. With DAX (currently broken but fixable) it is possible to have full cache coherency between guest and host and even between other guests.

virtiofs is used in production in macOS and ChromeOS and massively improved performance on Docker Desktop.

Awesome! I think what we will look into then is implementing 9pfs short term and turning around to implement virtiofs towards the end of the year to boost performance and compliance.

As always, your insight is very valuable!

azenla avatar Jul 30 '24 21:07 azenla

As always, your insight is very valuable!

Thank you @azenla!

DemiMarie avatar Jul 30 '24 21:07 DemiMarie