-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memfd backed memory #4138
Memfd backed memory #4138
Conversation
0eb43ad
to
6855b36
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #4138 +/- ##
==========================================
+ Coverage 82.95% 82.99% +0.03%
==========================================
Files 221 221
Lines 28501 28568 +67
==========================================
+ Hits 23643 23709 +66
- Misses 4858 4859 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
61a7c2f
to
e60e35d
Compare
2ddd564
to
4193777
Compare
9b25230
to
1db0fb9
Compare
1db0fb9
to
8d04c58
Compare
ad7471d
to
c75284a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit comment: Could you please format the commit messages? They include random new lines:
For example:
refactor(memory): moved vm_memory from utils
Moved `utils/vm_memory` crate into
`vmm/vstate/memory`.
Removed `utils/vm_memory`.
This module contains `vmm` specific code
and it make sense to have it in `vmm`.
Signed-off-by: Egor Lazarchuk <[email protected]>
should read:
refactor(memory): moved vm_memory from utils
Moved `utils/vm_memory` crate into `vmm/vstate/memory`. Removed
`utils/vm_memory`.
This module contains `vmm` specific codeand it make sense to have it in
`vmm`.
Signed-off-by: Egor Lazarchuk <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why move volatile
types to a separate module not under memory
?
c75284a
to
773a20a
Compare
@bchalios updated the commit messages. |
I opened #6763 for it, but its running into kani timeouts 😒 |
bc8c007
to
61e8321
Compare
b3c224f
to
9a33723
Compare
Moved `utils/vm_memory` crate into `vmm/vstate/memory`. Removed `utils/vm_memory`. This module contains `vmm` specific code and it make sense to have it in `vmm`. Signed-off-by: Egor Lazarchuk <[email protected]>
Moved all volatile related things into separate module. Signed-off-by: Egor Lazarchuk <[email protected]>
Renamed `Error` into `VmMemoryError` We try to avoid usind `Error` word for errors. Renaming it make is clearer what type of error this is. Signed-off-by: Egor Lazarchuk <[email protected]>
Changed names of some variables and used tuple unpacking. Signed-off-by: Egor Lazarchuk <[email protected]>
Moved all content of `memory_snapshot` module into `vstate/memory` module. Now all memory related code is in one place. Signed-off-by: Egor Lazarchuk <[email protected]>
Removed reexports of `vm_memory` error types from `vstate/memory.rs` Renamed `SnapshotMemoryError` into `MemoryError`. Now `memory` only has 1 error type it exposes. Signed-off-by: Egor Lazarchuk <[email protected]>
Changed `SnapshotMemory` trait to `GuestMemoryExtension` and moved all public methods that create GuestMemoryMmap into it. This removed a need for a public `test_utils` module and it makes all methods that directly act on `GuestMemoryMmap` to be associated with it. Signed-off-by: Egor Lazarchuk <[email protected]>
Added method to create `memfd` file with needed size and seals. Added an ability to construct `GuestMemoryMmap` backed by a file. Changed expected error message for failed memory creation in `test_api` test Signed-off-by: Egor Lazarchuk <[email protected]>
Added `from_raw_regions_file` method to the `GuestMemoryExtension` trait to remove duplicated code that creates file backed `GuestMemoryMap`. Signed-off-by: Egor Lazarchuk <[email protected]>
Added missing unit tests for memory creation methods. Split some unit tests into multiple for better readability. Signed-off-by: Egor Lazarchuk <[email protected]>
Updated `test_negative_file_size_limit` to check file size limit by simply starting a uVM, because now FC creates a memfd file for guest memory. Added positive test to verify that vm starts if limit is not hit. Signed-off-by: Egor Lazarchuk <[email protected]>
d0fea7f
to
995ed7d
Compare
Updated testing for read/write of guard pages. This testing is only possible with gnu target, so all tests that verify guard pages are marked to be compiled only for gnu target. Signed-off-by: Egor Lazarchuk <[email protected]>
Now when memory is backed by the file we store `FileOffset` inside each region. This information will be used to set up vhost-user shared memory. Signed-off-by: Egor Lazarchuk <[email protected]>
Now unit tests are run for musl and gnu targets. This is done, because we have some tests that only work with gnu. Signed-off-by: Egor Lazarchuk <[email protected]>
995ed7d
to
ef94eaf
Compare
Changes
Moved all memory related code into
vstate/memory.rs
module.Added ability to create
memfd
file to back guest memory.License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following
Developer Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md
.PR Checklist
CHANGELOG.md
.TODO
s link to an issue.rust-vmm
.