forked from firecracker-microvm/firecracker
-
Notifications
You must be signed in to change notification settings - Fork 8
[v1.14] Expose memory mapping & dirty pages; Make memfile dump optional #8
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
Closed
Closed
Changes from 12 commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
cd35b5a
swagger: add APIs for getting guest memory info
bchalios 2035236
snapshot: make memory path optional in snapshot creation
bchalios 160c3af
api: implement API for getting guest memory mappings
bchalios cd3fe9a
api: implement API for resident and zero memory
bchalios 92eacbd
api: implement API for dirty memory
bchalios e9febb1
feat: enable write-protection on guest memory
bchalios fff6fd9
ci: remove dependency changes test
bchalios a284adf
feat: make network device snapshots backwards compatible
bchalios 7a2ef60
snapshot: add state types for previous versions
bchalios ee3f6fa
feat: allow loading older snapshots
bchalios 458ca91
fix: compilation in aarch64
bchalios 9b2c7b5
feat(memfd): allow using memfd to back guest memory
bchalios 70d1aa9
refactor(block): expand ConfigSpace to full virtio-blk layout
kalyazin 17f5f3c
refactor(block): add Discard request type and discard segment struct
kalyazin a07c32a
feat(block): add discard method to FileEngine using fallocate
kalyazin c3bd76a
style(seccomp): fix indentation and trailing whitespace in filter files
kalyazin 432ca16
feat(seccomp): allow fallocate syscall in vmm thread filter
kalyazin 545d2b3
feat(block): handle VIRTIO_BLK_T_DISCARD requests
kalyazin 7662cac
chore(snapshot): fix ConfigSpace restore for VIRTIO_BLK_F_DISCARD
kalyazin 3901fd5
feat(block): advertise VIRTIO_BLK_F_DISCARD for non-read-only devices
kalyazin 6de4a4b
doc(block): document VIRTIO_BLK_F_DISCARD discard support
kalyazin 92a22cf
test(block): add unit tests for VIRTIO_BLK_F_DISCARD
kalyazin 772ad3c
test(block): add pytest integration tests for VIRTIO_BLK_F_DISCARD
kalyazin a4985d5
refactor(block): extend ConfigSpace with write-zeroes fields
kalyazin f70b108
refactor(block): add WriteZeroes request type and supporting variants
kalyazin 7c2a7b5
feat(block): add write_zeroes method to FileEngine using fallocate
kalyazin a4f3364
feat(block): handle VIRTIO_BLK_T_WRITE_ZEROES requests
kalyazin 0f4fd52
feat(block): advertise VIRTIO_BLK_F_WRITE_ZEROES for non-read-only de…
kalyazin 2aee8e9
test(block): add unit tests for VIRTIO_BLK_F_WRITE_ZEROES
kalyazin ace2b4e
test(block): add pytest integration tests for VIRTIO_BLK_F_WRITE_ZEROES
kalyazin ab2399e
doc(block): document VIRTIO_BLK_F_WRITE_ZEROES support
kalyazin bc19655
feat(balloon): advertise VIRTIO_BALLOON_F_HINT_WAIT_ON_ACK with FPH
kalyazin 1bfffbf
test(balloon): integration test for WAIT_ON_ACK negotiation
kalyazin f0a35a1
docs(balloon): document WAIT_ON_ACK feature
kalyazin 639196c
fix: saving/restoring async IO engine transport state
1de011d
fix(tests): fix compilation in integration test
bchalios b222edc
fix(discard_range): require page size alignment for region
bchalios bd85e43
fix(memory): punch holes for shared discard ranges
ValentaTomas 2c743d3
fix(io_uring): handle more robustly EINTR in io_uring_enter()
bchalios bfb1e40
fix(block): make prepare_save() more robust
bchalios 3a19026
fix(machine_config): remove unused MachineConfigUpdate import in tests
kalyazin 431f1fc
fix(memory): use madvise(MADV_REMOVE) to discard memfd ranges
kalyazin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| use micro_http::Method; | ||
| use vmm::rpc_interface::VmmAction; | ||
|
|
||
| use crate::api_server::parsed_request::{ParsedRequest, RequestError}; | ||
|
|
||
| pub(crate) fn parse_get_memory<'a, T>(mut path_tokens: T) -> Result<ParsedRequest, RequestError> | ||
| where | ||
| T: Iterator<Item = &'a str>, | ||
| { | ||
| match path_tokens.next() { | ||
| Some("mappings") => Ok(ParsedRequest::new_sync(VmmAction::GetMemoryMappings)), | ||
| Some("dirty") => Ok(ParsedRequest::new_sync(VmmAction::GetMemoryDirty)), | ||
| Some(unknown_path) => Err(RequestError::InvalidPathMethod( | ||
| format!("/memory/{}", unknown_path), | ||
| Method::Get, | ||
| )), | ||
| None => Ok(ParsedRequest::new_sync(VmmAction::GetMemory)), | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Missing pread64 syscall in aarch64 seccomp filter
High Severity
The
pread64syscall is added to the x86_64 seccomp filter but not to the aarch64 one. The new memory info features uselibc::preadinpagemap.rswhich runs on both architectures. Calling the/memory/dirtyor/memoryendpoints on aarch64 will trigger a seccomp violation and crash the VMM.Reviewed by Cursor Bugbot for commit 81d5796. Configure here.