Skip to content
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

Merged
merged 1 commit into from
Feb 16, 2024
Merged

Implement Instant for UEFI #120889

merged 1 commit into from
Feb 16, 2024

Conversation

Ayush1325
Copy link
Contributor

  • Uses Timestamp Protocol if present. Else use rdtsc for x86 and x86-64

@rustbot
Copy link
Collaborator

rustbot commented Feb 10, 2024

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 10, 2024
@rust-log-analyzer

This comment has been minimized.


static FREQUENCY: OnceLock<u64> = OnceLock::new();

// Get Frequency in Mhz
Copy link
Member

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).

Copy link
Member

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.

Copy link
Member

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.)

@Mark-Simulacrum
Copy link
Member

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 11, 2024
@joshtriplett
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Feb 11, 2024

📌 Commit 1793bc9 has been approved by joshtriplett

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 11, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 12, 2024
…lett

Implement Instant for UEFI

- Uses Timestamp Protocol if present. Else use rdtsc for x86 and x86-64
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 12, 2024
…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
@matthiaskrgr
Copy link
Member

@bors r- rollup=iffy
failed in #120984 (comment)

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 12, 2024
- Uses Timestamp Protocol if present. Else use rdtsc for x86 and x86-64

Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
@Ayush1325
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 13, 2024
@Noratrieb
Copy link
Member

force pushed diff looks good
@bors r=joshtriplett

@bors
Copy link
Contributor

bors commented Feb 15, 2024

📌 Commit dee2d0f has been approved by joshtriplett

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 15, 2024
@bors
Copy link
Contributor

bors commented Feb 16, 2024

⌛ Testing commit dee2d0f with merge 0f806a9...

@bors
Copy link
Contributor

bors commented Feb 16, 2024

☀️ Test successful - checks-actions
Approved by: joshtriplett
Pushing 0f806a9 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 16, 2024
@bors bors merged commit 0f806a9 into rust-lang:master Feb 16, 2024
12 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Feb 16, 2024
@Ayush1325 Ayush1325 deleted the uefi-instant branch February 16, 2024 04:32
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0f806a9): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This 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.

Cycles

Results

This 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.3% [-2.3%, -2.3%] 1
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 637.952s -> 637.219s (-0.11%)
Artifact size: 306.32 MiB -> 306.29 MiB (-0.01%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants