-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add support for VMClock device #5510
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5510 +/- ##
==========================================
+ Coverage 82.83% 82.87% +0.03%
==========================================
Files 269 270 +1
Lines 27723 27790 +67
==========================================
+ Hits 22965 23030 +65
- Misses 4758 4760 +2
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:
|
1f319ea to
a62ac4c
Compare
|
FYI: dropped the commit that enabled VMClock in our guest kernels. Apparently the config is already present in the AL kernels |
vmclock is added in Linux 6.13. Upgrade the version we are using to create Rust bindings from to this version so we can get vmclock ABI definitions. Signed-off-by: Babis Chalios <bchalios@amazon.es>
Decouple creation of VMGenID device with writing the generation ID in guest memory. This way we can avoid keeping an `Option<VmGenId>` inside the ACPI device manager. We can always create it and only write the generation ID in guest memory once we are ready to activate the device (when we have a functioning guest memory object). Also, remove a few of the error types and fail in-place instead of propagating errors all the way up. On the Aarch64, we need to recreate the expected dtb files because default microVMs always create entries for the VMGenID device. Signed-off-by: Babis Chalios <bchalios@amazon.es>
Add bindings for vmclock ABI from Linux 6.13, also add the logic in tools/bindgen.sh to automate the process. Signed-off-by: Babis Chalios <bchalios@amazon.es>
Implement the VMClock device on x86_64 platforms. At the moment, we just allocate the memory region in the guest address space for exposing the device. We don't expose any clock from the host and since we don't support live migration, the device won't do anything at the moment, but we should still be able to see a `/dev/vmclock` inside the guest. We do support the `disruption_marker` field which notifies the guest to adjust clocks due to a time shifting event. Signed-off-by: Babis Chalios <bchalios@amazon.es>
Add tests that validate that VMClock device as exposed inside the guest under /dev/vmclock0 works as expected. This includes a small C program that knows how to open and read values from /dev/vmclock0. Signed-off-by: Babis Chalios <bchalios@amazon.es>
Changes
Add basic support for VMClock device in Firecracker. VMClock is a virtual device that conveys information that help guest synchronise applications clocks against real wallclock time. The device is implemented as an ACPI device in Linux, as a result we can now support it only in x86.
For the time being we only support the
disruption_markercapability of the device, which informs the guest that there has occurred some disrupting event and hence applications need to re-synchronize their clocks. We don't provide any underlying clock information which helps with calibration.Reason
We want to start using the device to help guests know when they need to re-calibrate clocks. In the future we might also pass in information that helps with clock synchronization.
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 --allto verify that the PR passesbuild checks on all supported architectures.
tools/devtool checkstyleto 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.