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 default priority order (when handled in M-mode) #110

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

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.

I'm a bit confused with the nominally the same priority as a machine external interrupt with priority number p statement.

For example, if we have set S-level external interrupts iprio = 42
and in M-mode we have pending both

  • S-level external interrupts
  • M-level external interrupts with external interrupt identity (mtopei.identity) = 42

do we have two interrupts with absolutely same priorities? How we determine which should trigger first?

On the other hand, if we should use the default priority order rules - then it's not clear why do we phrase it like
... the same priority as a machine external interrupt with priority number p
instead of
... the same priority as a supervisor external interrupt with priority number p

Such phasing should be valid but it clearly shows that default priority order should be used.

Thanks!

@jhauser-us
Copy link
Collaborator

do we have two interrupts with absolutely same priorities? How we determine which should trigger first?

We have two interrupts with the same nominal priority, meaning the same priority number (hence, the appearance of having the same priority). In the same section, the AIA says, "When two interrupt causes have been assigned the same nominal priority, ties are broken by the default priority order." The AIA is clear that S-level external interrupts have lower default priority than M-level external interrupts.

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