-
Notifications
You must be signed in to change notification settings - Fork 44
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
ARM64 cycle count #216
Comments
I confirm that it's what |
From https://cpucycles.cr.yp.to/counters.html:
So, if it is "only" 24MHz (the vct that we're using), there's no wonder we're sometimes retrieving the same value out of it. At the same time, I'm not sure what to do (esp. since I don't use any arm64 device - questions include whether that is good enough, good enough for MirageOS, or we should change to something else)? Any opinions? |
previously, cntvct_el0 was used which is capped to 24 MHz, leading to entropy test failures on macOS and linux-aarch64. The PMCCNTR_EL0 is not available in user-space normally (for Linux, there is a kernel module). So, what we do is similar to the ARM32 code path now. Fixes mirage#216
previously, cntvct_el0 was used which is capped to 24 MHz, leading to entropy test failures on macOS and linux-aarch64. The PMCCNTR_EL0 is not available in user-space normally (for Linux, there is a kernel module). So, what we do is similar to the ARM32 code path now. Fixes mirage#216
tried to use |
Since we switched from Cstruct.t to string, there are some failures on arm64 architectures that
read_virtual_count
returns the same value in subsequent calls to it (see tests/test_entropy.ml).What we use:
I suspect the
"mrs %0, cntvct_el0":"=r"(c)
is what is called. This is for both freestanding (i.e. MirageOS) and Unix applications (the test that fails above is only executed on Unix).How should this be dealt with?
clock_gettime(CLOCK_MONOTONIC, _)
for Unix applications?The issue with conditional compilation is potential bitrot and code that is executed less often (and thus may be broken once you deploy it for real). But since we already have conditional compilation for arm32, riscv - it may be the path to go.
Any opinions?
The text was updated successfully, but these errors were encountered: