-
Notifications
You must be signed in to change notification settings - Fork 2k
[feature/virtio-mem] Add dummy implementation for virtio-mem #5365
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
Draft
Manciukic
wants to merge
13
commits into
firecracker-microvm:feature/virtio-mem
Choose a base branch
from
Manciukic:virtio-mem/dummy
base: feature/virtio-mem
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[feature/virtio-mem] Add dummy implementation for virtio-mem #5365
Manciukic
wants to merge
13
commits into
firecracker-microvm:feature/virtio-mem
from
Manciukic:virtio-mem/dummy
Conversation
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
We were using bindgen from 3 different sources: - installed headers in the system - linux-5.10.y branch from amazonlinux repo - linux-next branch from torvalds repo This is overcomplicated and unnecessary as Linux doesn't break the UAPI. This patch updates it to use a single stable branch (6.12), from which the user headers are generated using `make headers_install` and regenerates all the headers, fixing some minor incompatibilities in the syntax. While I was at it I also improved the generation for C enums to use constified-enum-module style which is less verbose. I had to fix an issue with the io_uring auto-generated structs not implementing Copy due to FAM introduced in the latest kernels. I have put a bindgen-patch to drop the FAM and derive Copy and Clone where required to implement ByteValued. If we ever need to use those fields, we'll need to find a different solution. Signed-off-by: Riccardo Mancini <[email protected]>
Currently, the device ids (TYPE_*) are hardcoded in various places. With this change, they are generated from linux headers. Signed-off-by: Riccardo Mancini <[email protected]>
Update the Kconfig to enable support for virtio-mem in the guest. Signed-off-by: Riccardo Mancini <[email protected]>
virtio-mem requires a new Kconfig, so I've rebuilt the artifacts and now I'm making the devctr point to those. Signed-off-by: Riccardo Mancini <[email protected]>
Automatically generate bindings for virtio-mem. Signed-off-by: Riccardo Mancini <[email protected]>
Create the new module for the virtio-mem device. Signed-off-by: Riccardo Mancini <[email protected]>
Allow to configure the virtio-mem device from the VmmConfig and the PUT API to /hotplug/memory. Signed-off-by: Riccardo Mancini <[email protected]>
Test the freshly added PUT API to /hotplug/memory. Signed-off-by: Riccardo Mancini <[email protected]>
Add a dummy virtio-mem device that is detected by the guest driver. The device is configured with total_size, block_size, and slot_size, and uses a fixed address after the MMIO64 memory zone. Signed-off-by: Riccardo Mancini <[email protected]>
Check that the driver correctly detects the virtio-mem device, with the correct parameters. Signed-off-by: Riccardo Mancini <[email protected]>
c9b0e64
to
80aa1de
Compare
11ab91d
to
891017d
Compare
Make the with_virtio_device_with_id function more generic and introduce its variant with error handling try_with_virtio_device_with_id. Then use these new functions in vmm.rs whenever we need to perform an action on a device. To simplify the code, I also moved some balloon device error handling back to the balloon device code and refactored it a little bit. Signed-off-by: Riccardo Mancini <[email protected]>
Remove some error variants that were not used in the code. Signed-off-by: Riccardo Mancini <[email protected]>
Add support for GET /hotplug/memory that returns the current status of the virtio-mem device. This API can only be called after boot. Signed-off-by: Riccardo Mancini <[email protected]>
891017d
to
904b043
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## feature/virtio-mem #5365 +/- ##
======================================================
- Coverage 82.35% 82.28% -0.07%
======================================================
Files 265 270 +5
Lines 30640 31005 +365
======================================================
+ Hits 25233 25512 +279
- Misses 5407 5493 +86
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes
Add a dummy implementation for virtio-mem device.
Add PUT and GET APIs for /hotplug/memory.
Reason
Support for Virtio Mem
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
tools/devtool checkbuild --all
to verify that the PR passesbuild checks on all supported architectures.
tools/devtool checkstyle
to verify that the PR passes theautomated style checks.
how they are solving the problem in a clear and encompassing way.
in the PR.
CHANGELOG.md
.Runbook for Firecracker API changes.
integration tests.
TODO
.rust-vmm
.