-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Fix riscv_machine_timer mtime read #10859
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10859 +/- ##
=======================================
Coverage 53.27% 53.27%
=======================================
Files 215 215
Lines 25851 25851
Branches 5695 5695
=======================================
Hits 13773 13773
Misses 9762 9762
Partials 2316 2316
Continue to review full report at Codecov.
|
This issue could lead to some timer freeze. If that system is running at 100 Mhz, the freez would be about 40 seconds, and if the timer is running at 1Khz it would happen each 10 days. |
Fix riscv_machine_timer mtime non-atomic 64 bits read. Signed-off-by: Charles Papon <[email protected]>
@Dolu1990 The code looks good. I think your analysis of the freeze is wrong. Unless some nested higher-priority interrupt(s) block the timer handler for near 2^32 mtime cycles, the loop will never iterate more than twice before it succeeds to get two consecutive identical reads of mtimeh. |
Oulala, look like there is some serious business around the timer ^^ |
<3 |
This pullrequest fix #10788