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

Add ARM support. #91

Merged
merged 6 commits into from
Sep 25, 2023
Merged

Add ARM support. #91

merged 6 commits into from
Sep 25, 2023

Conversation

tobz
Copy link
Member

@tobz tobz commented Sep 24, 2023

Context

This PR adds support for ARM by querying the system counter via the cntvct_el0 register. This is the spiritual equivalent of querying the TSC on x86_64 via rdtsc.

Notes

Currently, this PR just adds support for the "counter" implementation, as mentioned above. In practice, 64-bit ARM systems (AArch64, which was introduced with the ARMv8 architecture) did not have a fixed frequency for the system counter until ARMv8.6-A, and had an implementation-defined frequency of anywhere from 1MHz to 50MHz. This is naturally at odds with striving for nanosecond precision.

As it stands, we simply utilize the normal calibration loop. In the future, once we have access to a system with a recent enough ARM processor, we can add fast path support for using the known system counter frequency and optimizing our reference-to-counter timebase conversion logic. This is also in line with the desire to utilize known TSC frequency information for Intel CPUs to avoid the expensive/jitter-y calibration procedure.

@tobz tobz merged commit 8ba2515 into main Sep 25, 2023
21 checks passed
@tobz tobz deleted the tobz/add-arm-support branch September 25, 2023 22:43
@tobz
Copy link
Member Author

tobz commented Oct 4, 2023

Released as [email protected].

@loyd
Copy link
Contributor

loyd commented Oct 18, 2023

release notes?

@tobz
Copy link
Member Author

tobz commented Oct 18, 2023

Woops, looks like I cut the release from the PR branch so the changelog only got updated there and not on main.

All set now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants