new qos_clock crate and boot-time kvm-clock validation#668
Draft
emostov wants to merge 1 commit into
Draft
Conversation
a1c8b47 to
0270dc2
Compare
0270dc2 to
1b7d42b
Compare
emostov
commented
Apr 14, 2026
| } | ||
|
|
||
| /// Source of Unix wall-clock time for expiry and freshness checks. | ||
| pub trait WallClock: Send + Sync { |
Contributor
Author
There was a problem hiding this comment.
Realistically we could get around needing a trait and just use SystemTime::now().duration_since(SystemTime::UNIX_EPOCH). But trait might be useful for testing when we want to control time
| self.unix_time_millis()? | ||
| .checked_div(1_000) | ||
| .ok_or(WallClockError::TimeConversionFailed) | ||
| } |
Contributor
There was a problem hiding this comment.
The default implementation for SystemTime is inefficient... it's already a u64
https://doc.rust-lang.org/stable/src/core/time.rs.html#506
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
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.
Summary & Motivation (Problem vs. Solution)
This is meant to demonstrate how we could ensure we are using the kvm-clock.
This article discusses why the KVM clock https://blog.trailofbits.com/2024/09/24/notes-on-aws-nitro-enclaves-attack-surface/#time
Specifically
Note this does not cover configuring PTP synchronization. This must be done on the parent ec2 instance
How I Tested These Changes
Pre merge check list