-
Couldn't load subscription status.
- Fork 53
Major and external interrupts unification #606
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
base: master
Are you sure you want to change the base?
Major and external interrupts unification #606
Conversation
c897499 to
e3bb1ef
Compare
|
On the face of it this PR appears to remove vectoring of the minor interrupts, while retaining the minor interrupt concept which is foundational to AIA. This does not make sense. |
e3bb1ef to
1163f57
Compare
92f3f94 to
425c896
Compare
|
Hi @mark-honman, I've updated the document description to clarify the proposed modification (specifically, the Since this PR unifies major and external interrupts, it also simplifies several related areas, such as:
hence, there are several changes in other chapters as well. |
|
|
||
| NOTE: all major interrupts keep their identity numbers. | ||
|
|
||
| In this mode CLINT is not used and doesn't influence the interrupt handling. |
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.
CLINT is not really a thing in the world of RISC-V standards
|
high level comment: I can see small benefits on HW side, while I do also concern about SW (suddenly, and OS kernel will rely on a driver for external interrupt controller to be able to e.g. set the SW interrupt). |
|
This PR was presented by Evgenii to Fast Interrupts TG on 29th September 2025. @evgeniy-paltsev, could you attach the slides? |
|
was there any input from the TG? |
|
what is the layout of the unified vector table? First 64 entries reserved for major interrupts? Platform defined? |
In addition to sharing the slides via the tech-fast-int mailing list, I'm attaching them here as well. |
Could you clarify this a bit? Am I correct in understanding that you're suggesting a single entry point for all major interrupts?
I'm not sure I fully follow your concern here. If the new HW features aren't used, then no SW changes are needed. But if they are used (e.g., interrupt nesting), then naturally the SW must be updated to support them. |
Yes. This was previously floated by Mark and makes a ton of sense.
Everything CAN be supported in SW - so is the nature of software. But for maintenance, quality, ramp-up purposes it is preferable to have architecture support that is not full of ifdefs for different flavors of the architecture. A new feature is a new feature and needs additional code to be supported. |
Entry 0 - pointer to exception handler The major interrupts retain their original identity numbers, so their positions in the vector table are fixed. The remaining identity numbers (those not assigned to implemented major interrupts) are available for use by external interrupts. |
It doesn't really matter if we call it device driver or not. I.e. in Zephyr we have even a 'clint' interrupts as a driver and not in
Interrupt unification is not a standalone extension - it's part of the nesting and vectoring mechanism designed to enable low-latency interrupt handling. Supporting low-latency interrupts in the OS requires substantial software changes - from trap handlers modifications (regardless of whether tpush/tpop or manual context save/restore is used) and IVT layout adjustments to updates to interrupt lock/unlock logic and changes to task switching implementation.
By the way, in your example, no software changes are required - since the SW interrupt is an MMIO device, its pending bit is set and cleared via MMIO. |
It may work for specific use cases, but it's not suitable as a general solution. Even with just two standard major interrupts (timer and SW), there's a clear counterexample: if we want to implement task switching similar to ARM's NVIC model in Zephyr (with the task context switch happens in the SW interrupt handler) we wouldn't want to share the SW interrupt vector with the timer. And such limitations are easily avoidable, since interrupt unification provides a straightforward way to support vectoring for all interrupts. |
The difference would be marginal. In the context of an entire context switch, selecting between two possible interrupt sources is nothing. |
How it is set is platform defined. How it is cleared is standardized and this is via the mip/sip bit. |
The discussion about accessing the pending bit for particular source looks strange considering the fact that in case of nested vectored interrupt entire OS kernel implementation is in separate source tree (see the Arm's Zephyr ports). RISC-V at the moment has no support for nested vectored interrupts, so the whole branch is vacant. In such case it is better (portability, maintainability, etc.) to unify the way of interrupt handling (including access to pending bits) for all interrupts. |
This PR unifies major and external interrupts by forwarding all major interrupts to ACLIC when the ACLIC mode is selected. The additional technical details and discussion can be found in the #605 issue.
Fixes: #605