-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
riscv m-timer is schduled multiple times per interrupt. #12407
Comments
@g2gps Yep it's good to test on knsh32 and knsh64. Most of the 64-bit RISC-V ports were derived from knsh64 with OpenSBI, without SSTC. |
Ok, thanks for the suggestions. I'll put together a PR early next week, when I have a chance to test this out properly. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While profiling some of the litex layers, I found that the riscv mtimer is scheduled through openSBI multiple times per alarm interrupt. This isn't ideal, as the openSBI ecall is relatively expensive on platforms which don't have the supervisor time (sstc) extension. I don't think there is any reason for this behavior to remain as it is. The only requirement from the riscv machine timer is that it is written once to clear the pending interrupt.
I've done proof on concept locally where the next update time is cached as part of the instance, and updated once at the end of the timer interrupt, which works, but it needs to be tested more thoroughly.
What is a good test configuration to verify that updated behavior is correct? I was thinking qemu-rv:knsh32 with ostest enabled, along with testing on our platform, as it's the only other suitable platform we have available.
Open to suggestions.
The text was updated successfully, but these errors were encountered: