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

Interrupt ID ordering recommendations #219

Closed
divan0v opened this issue Mar 13, 2022 · 12 comments · Fixed by #404
Closed

Interrupt ID ordering recommendations #219

divan0v opened this issue Mar 13, 2022 · 12 comments · Fixed by #404

Comments

@divan0v
Copy link
Contributor

divan0v commented Mar 13, 2022

Clarify, please, interrupt ID ordering recommendations.

It seems to me that lines after table in chapter 15 (CLIC Interrupt ID ordering recommendations) contradict with line:
"Original recommendation: The original basic mode interrupts retain their interrupt ID in CLIC mode."

Thanks

@ilg-ul
Copy link

ilg-ul commented Mar 13, 2022

Please note that, when using vectored interrupts, in order to avoid unnecessary complexity in a scheduler, it is recommended to reserve the absolute lowest priority interrupt for context switching.

This allows all other handlers to no longer need to deal with saving/restoring registers, but simply pend the context switching interrupt, which will be tail chained when all other nested higher priority interrupts are completed.

Right now the list in chapter 15 starts with User/Supervisor/Machine software Interrupt, but I could not find an explicit mention of which interrupt to use for context switching.

Perhaps this detail should be added to the specs too.

@kasanovic
Copy link
Contributor

The csip interrupt was meant for the background thread, and is allocated such as to have the lowest fixed priority (so an interrupt level does not need to be expended on making it the background thread). The CLINT M/S/U interrupt signals can be added (in parallel) as CLIC inputs in CLIC mode, and then prioritized using CLIC facilities.
The exact numbering for local interrupts across all interrupt controllers needs more discussion -there is overlap with other local interrupts including in the AIA.

@dansmathers
Copy link
Collaborator

will move recommendation of csip to 16 for now to avoid conflicts with AIA. CSIP stands for context switch interrupt pending. will add this clarification to spec. will try to connect csip to context switching text to chapter 15.

dansmathers added a commit that referenced this issue Aug 29, 2022
for issue #219 
moved csip to id 16 to not conflict with AIA ordering.  added mention that it might be used for context switching.

Signed-off-by: Dan Smathers <[email protected]>
kasanovic added a commit that referenced this issue Aug 30, 2022
csip interrupt ordering clarification for issue #219
@dansmathers
Copy link
Collaborator

closed by pull #260

@divan0v
Copy link
Contributor Author

divan0v commented Aug 30, 2022

It seems to me that this issue is closed too early.

Original question was a request to clarify contradiction between line:
"CLINT mode compatibility recommendation: The CLINT mode interrupts retain their interrupt ID in CLIC mode."
and lines:
"M-mode only or M/U mode interrupt map recommendation: (in M-only or M/U system without N extension) 0:
M-mode software interrupt 1: M-mode timer interrupt 2+: external (including legacy)
M-mode interrupt map in M/S/U system without N extension recommendation: 0: S-mode software interrupt 1:
S-mode timer interrupt 2: M-mode software interrupt 3: M-mode timer interrupt 4+: external (including legacy)
Interrupt map with PLIC recommendation: 0: S-mode software interrupt 1: S-mode timer interrupt 2: S-mode
external (PLIC) interrupt 3: M-mode software interrupt 4: M-mode timer interrupt 5: M-mode external (PLIC) interrupt 6: external"

Because last lines recommend to move interrupt IDs to new places (not matched with table). Or have I misinterpreted?

@dansmathers
Copy link
Collaborator

I updated the formatting of the interrupt recommendation tables to make it more obvious that there are 4 different recommendations depending on the profile that might be targeted. different recommendations were developed based on issue #89 "Being that software will need to handle interrupts differently in CLIC mode vs basic mode, why do we need to have the lower 16 CLIC IDs match the basic interrupt controller?"

Does this make more sense? if not, go ahead and reopen this issue. Thanks.

@divan0v
Copy link
Contributor Author

divan0v commented Aug 31, 2022

  1. May be rewrite this phrase: "The CLINT mode interrupts retain their interrupt ID in CLIC mode."?
  2. Which number has csip in 15.2, 15.3, 15.4?

@dansmathers dansmathers reopened this Aug 31, 2022
dansmathers added a commit that referenced this issue Aug 31, 2022
for issue #219   
Add text that specifies that these different interrupt ID recommendations are enumerated for reference in risc-v profile (ISA features) specifications.
Change PLIC to PLIC/APLIC since recent risc-v platforms (specifications for a hardware system) refer to APLIC.

Signed-off-by: Dan Smathers <[email protected]>
@dansmathers
Copy link
Collaborator

Can you look at the pull? I tried to point out that these are four different incompatible orderings enumerated here to guide common orderings for software compatibility. some implementations will not need csip so it is not included in 15.2, 15,3, 15.4. more information about profiles can be found here: https://github.com/riscv/riscv-profiles/blob/main/profiles.adoc#profiles-versus-platforms

@divan0v
Copy link
Contributor Author

divan0v commented Aug 31, 2022

Thanks for pull. It seems good for me.
Motivation for 4 tables became clearer for me.
Thanks.

@dansmathers
Copy link
Collaborator

Pull #265 merged. additional text clarification added during TG meeting. closing this for now.

dansmathers added a commit that referenced this issue Sep 13, 2022
09/13/2022  issues #219/#222 - CLIC interrupt ordering text clarifications.

Signed-off-by: Dan Smathers <[email protected]>
@dansmathers
Copy link
Collaborator

discussion about if this section should even be in the spec or moved to the appendix. should the recommendations be allowed to conflict with priv spec? also reference #89.

@dansmathers dansmathers reopened this Sep 9, 2024
@christian-herber-nxp
Copy link
Collaborator

As it is a recommendation, it belongs in the appendix and is non-normative.
I can imagine that the ARC might want it to be normative, but I would wait for that.
Moving it to the appendix is just improving clarity, making it normative is a spec change.

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 a pull request may close this issue.

5 participants