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

S-level external interrupts priority value when handled in M-mode #109

Open
evgeniy-paltsev opened this issue Dec 10, 2024 · 1 comment
Open

Comments

@evgeniy-paltsev
Copy link

The AIA spec says

If supported, setting the priority number for supervisor-level external interrupts (bits 15:8 of
iprio2) to a nonzero value p has the effect of giving the entire category of supervisor external
interrupts nominally the same priority as a machine external interrupt with priority number p.

We specify the case when iprio != 0, but we don't specify the iprio = 0 case.
So I'm wondreng what happens if the priority number for S-level external interrupts is set to 0 and S-level external interrupts are handled in M-mode?

Do we handle iprio = 0 same way as for any other M-level interrupt? Or we use external (minor) interrupt identity from stopei to form S-level external interrupt priority?

Thanks in advance!

@jhauser-us
Copy link
Collaborator

we don't specify the iprio = 0 case.

Yes we do.

In the AIA section titled "Defined major interrupts and default priorities" (5.1), the first table is clear that supervisor-level exterrnal interrupts (SEIs) have lower default priority than machine-level external interrupts. (In fact, all supervisor-level interrupts have lower default priority than all machine-level interrupts.) Next, if we look at the table in the section titled "Configuring priorities of major interrupts at machine level" (5.2.1), an SEI is covered by the rightmost column, "Interrupts with default priority below machine external interrupts". If the iprio array entry for SEI is zero, the relevant table entry is the "0" is at the bottom of that column. So in this case, the table is saying that an SEI that traps to M-mode will be lower priority than all other interrupts except those with both iprio array entry also zero and an even lower default priority than SEI.

The sentence you quoted is just trying to make sure there is no misunderstanding about the case when SEI's iprio number is not zero (so at a higher position in the same table column).

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

No branches or pull requests

2 participants