Conversation
There was a problem hiding this comment.
LGTM! Note I notcied cargo test --features gdb -p hyperlight-host -- hypervisor::gdb::tests::mem_access_tests::test_mem_access_write fails, are we fine with this? Unsure if it fails on main.
Btw this is awesome
snapshots/restore/large time: [56.654 µs 58.220 µs 60.077 µs]
change: [−99.864% −99.829% −99.779%] (p = 0.00 < 0.05)
Performance has improved.
For historical reasons, PEB setup still happened when an uninitialised sandbox was created, instead of happening at snapshot time, which is far more sensible. This removes the need for the snapshot memory to be writable during initialisation. Signed-off-by: Lucy Menon <168595099+syntactically@users.noreply.github.com>
Signed-off-by: Lucy Menon <168595099+syntactically@users.noreply.github.com>
Whenever we are not running with certain features that still require legacy writable access to the snapshot region (currently: nanvix-unstable, gdb), map the snapshot region directly into the VM. This lays the groundwork for sharing a single snapshot memory between multiple VMs. Signed-off-by: Lucy Menon <168595099+syntactically@users.noreply.github.com>
Previously, if a sandbox mapped one physical page to multiple virtual addresses, taking a snapshot would duplicate the page. This commit changes the logic around snapshots to keep track of the physical pages that have been encountered during the virtual memory traversal so far, and ensure that the same page is not copied multiple times. Note that this does not (yet) track the contents of pages to allow de-duplicating them---it merely ensures that two mappings of the same physical address do not result in needless duplication. Signed-off-by: Lucy Menon <168595099+syntactically@users.noreply.github.com>
Previously, the page table manipulation interfaces exported for the use of guests did not permit unmapping an existing mapped range. This commit improves that situation, by adding an "unmapped" mapping type, which code can use to request that a remap operation make a region not-present. Signed-off-by: Lucy Menon <168595099+syntactically@users.noreply.github.com>
Silence spurious panic warning Signed-off-by: Lucy Menon <168595099+syntactically@users.noreply.github.com>
Address review comments Signed-off-by: Lucy Menon <168595099+syntactically@users.noreply.github.com>
5541ff3 to
7054dd5
Compare
As far as I can tell this test was causing UB (causing a write to happen to an mmap region, which other threads may be reading from based on the contract we documented for mmap regions), so I think it is correct to fail. We could get rid of / rewrite it, but if it already isn't in CI for some reason I'd rather do that later. |
Fix clippy warnings with all features enabled Signed-off-by: Lucy Menon <168595099+syntactically@users.noreply.github.com>
This starts to move to actually take advantage of the fact that snapshots are now RO by not copying them all the time (although they still aren't loadable-from-disk). It also includes a few other tweaks to improve snapshot creation.