-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Implement Instant for UEFI #120889
Implement Instant for UEFI #120889
Conversation
Ayush1325
commented
Feb 10, 2024
- Uses Timestamp Protocol if present. Else use rdtsc for x86 and x86-64
rustbot has assigned @Mark-Simulacrum. Use r? to explicitly pick a reviewer |
This comment has been minimized.
This comment has been minimized.
c17cdcd
to
1793bc9
Compare
|
||
static FREQUENCY: OnceLock<u64> = OnceLock::new(); | ||
|
||
// Get Frequency in Mhz |
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.
It feels surprising to me that frequency is a constant (i.e., only read from cpu id once).
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.
On any modern x86 platform, the TSC is independent of frequency changes, and continues running in sleep states. The former has been true for longer than UEFI has existed; the latter for less time, but having it not hold true in UEFI firmware would require a UEFI platform that enters a CPU C-state (sleep state) while user code is running.
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.
(There is also complexity associated with attempting to use it in an SMP system, since it may not be synchronzed across CPUs, but that's not typically an issue in UEFI.)
cc @nicholasbishop @dvdhrm (target maintainers: https://doc.rust-lang.org/nightly/rustc/platform-support/unknown-uefi.html), needs an approval per https://std-dev-guide.rust-lang.org/policy/target-code.html. |
@bors r+ |
…lett Implement Instant for UEFI - Uses Timestamp Protocol if present. Else use rdtsc for x86 and x86-64
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#118983 (Warn on references casting to bigger memory layout) - rust-lang#119451 (Gate PR CI on clippy correctness lints) - rust-lang#120273 (compiletest: few naive improvements) - rust-lang#120889 (Implement Instant for UEFI) - rust-lang#120938 (Implement sys/thread for UEFI) - rust-lang#120950 (Fix async closures in CTFE) - rust-lang#120958 (Dejargonize `subst`) - rust-lang#120965 (Add lahfsahf and prfchw target feature) - rust-lang#120970 (add another test for promoteds-in-static) - rust-lang#120979 (Update books) Failed merges: - rust-lang#120973 (allow static_mut_ref in some tests that specifically test mutable statics) r? `@ghost` `@rustbot` modify labels: rollup
@bors r- rollup=iffy |
- Uses Timestamp Protocol if present. Else use rdtsc for x86 and x86-64 Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
1793bc9
to
dee2d0f
Compare
@rustbot ready |
force pushed diff looks good |
☀️ Test successful - checks-actions |
Finished benchmarking commit (0f806a9): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 637.952s -> 637.219s (-0.11%) |