-
Notifications
You must be signed in to change notification settings - Fork 94
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
Clarify the description of the set_timer
function
#155
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a clarification, it's a change.
@aswaterman Hmm, in that case, can I kindly check on what is the current expected behavior? More concretely:
Or did you mean that explicitly specifying these in the spec is a significant change? I used the phrase "may not" for the pending interrupt bit clearing and the possible error codes seem to make sense, but do correct me if I am wrong or if I assumed something along the way. |
The way the current spec is written, it’s clear that supervisor-level software can rely on the pending interrupt being cleared regardless of whether it’s masked. So this is a backwards-incompatible change from supervisor-level software’s perspective. Whether this is a “significant” change depends on factors I can’t personally speak to, but it’s still a change, and therefore it’s not a clarification. |
I agree with @aswaterman . Allowing supervisor software to set Overall, NACK to this PR from my side. |
Ah got it, it was not clear on my side about this. It seems that OpenSBI is not implementing this though, at least when I was testing it with my
I was also not aware of this. In that case, let me remove that part from this PR. |
Defining this call to possibly fail is also backwards-incompatible. I think it’s best to close this PR. |
Hmm does that mean that In that case, then I agree that this PR should be closed. Thank you for all of the clarifications. I will incorporate this feedback when I am writing my tests for |
I think some clarification is necessary. We shouldn't allow a nonzero sbiret.error to be set and still consider the SBI call to be successful, so I think explicitly stating that sbiret.error must be SBI_SUCCESS is necessary (even it if it's technically not a backward compatible change). For the masking clarification, I think the "either...or..." wording of the second paragraph implies that masking the timer interrupt will "clear the timer interrupt". Changing the wording to something like """ |
I can reopen this PR if folks feel that some clarifications on the 2 points above can benefit the community. |
164bd08
to
9fce46f
Compare
As recommended by @jones-drew, I have reopened this PR. Since the intention has always been to clarify the description, I have made some adjustments to the phrasing of the sentences that involve clearing the pending timer interrupt bit to hopefully better portray the intended meaning. As I am not very familiar with the language of formal specifications, any feedback is welcome and greatly appreciated. Thank you! |
79e06c6
to
199318f
Compare
Improve the phrasing on the clearing of the pending timer interrupt bit when timer interrupts are masked. Additionally, clarify that this function can never fail. Signed-off-by: James Raphael Tiovalen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed-by: Andrew Jones [email protected]
Improve the phrasing on the clearing of the pending timer interrupt bit when timer interrupts are masked.
Additionally, clarify that this function can never fail.
CC: @atishp04 @jones-drew