riscv / riscv-isa-manual

RISC-V Instruction Set Manual
https://riscv.org/
Creative Commons Attribution 4.0 International
3.7k stars 645 forks source link

Which interrupt has higher priority between LCOFI and SGEI? #1678

Closed demin-han closed 1 month ago

demin-han commented 1 month ago

section 3.1.9 Multiple simultaneous interrupts destined for M-mode are handled in the following decreasing priority order: MEI, MSI, MTI, SEI, SSI, STI, LCOFI

section 19.2.3: Multiple simultaneous interrupts destined for HS-mode are handled in the following decreasing priority order: SEI, SSI, STI, SGEI, VSEI, VSSI, VSTI.

for LCOFI and SGEI, which has higher priority?

gfavor commented 1 month ago

For both M-mode and S-mode, LCOFI is lower priority than STI. So, for consistency, one would expect LCOFI to also be lower priority than VSTI for HS-mode.

@jhauser-us Do you agree?

@demin-han Please go ahead and create a PR that adds LCOFI to the end of the list from section 19.2.3 that you quoted. @jhauser-us or @aswaterman can then approve the PR (assuming they agree with it).

Thanks.

demin-han commented 1 month ago

For both M-mode and S-mode, LCOFI is lower priority than STI. So, for consistency, one would expect LCOFI to also be lower priority than VSTI for HS-mode.

@jhauser-us Do you agree?

@demin-han Please go ahead and create a PR that adds LCOFI to the end of the list from section 19.2.3 that you quoted. @jhauser-us or @aswaterman can then approve the PR (assuming they agree with it).

Thanks.

In AIA, I found: image

LCOFI has lowest priority in standard interrupt, which is consistent with your said.

aswaterman commented 1 month ago

Agreed with the above; fix via #1679 has been merged.