Summary
Hyperlight's map_file_cow creates READ+EXECUTE memory regions (no WRITE). Nanvix's VFS/FAT32 layer requires writable memory for the RAMFS image. Currently, Nanvix works around this by copying the entire RAMFS image from the read-only MMIO region to a heap-allocated buffer on Hyperlight (see nanvix/nanvix#1729).
Proposal
Behind the nanvix-unstable feature flag, make map_file_cow produce RWX (read-write-execute) memory regions instead of RX (read-execute). This would allow Nanvix to mount the RAMFS image directly from the mapped memory without the extra heap copy.
Context
- The workaround is in
src/libs/nvx/src/lib.rs in the Nanvix repo, cfg-gated to the hyperlight feature.
- Once this is implemented, Nanvix will revert the heap-copy workaround.