Change the NVIC APIs protocol for box 0, to enable backwards-compatibility of legacy code
- Dominant language
- C
- Stars
- 135
- Forks
- 72
- PR merge metrics
- No merged PRs in 30d
Description
The uVisor vIRQ APIs require an interrupt to be registered before being used. Registration is done via the `NVIC_SetVector(irqn, vector)` API, which assigns exclusive IRQ access on a first-come-first-served fashion.
The requirement on using `NVIC_SetVector` first is not backwards-compatible with many legacy drivers, where the default in-flash link-time vector is used and `NVIC_SetVector` is never called.
**We should change the implementation of the vIRQ APIs for box 0, so that legacy drivers can still work without ever calling `NVIC_SetVector`.**
Any change targeting an IRQ slot that comes from box 0 will imply that box 0 has acquired exclusive ownership of that IRQ. The in-flash handler will be used as the IRQ handler.
The uVisor will not actively prevent different software modules in box 0 from stealing each others' IRQ slots. This is an OS-integration problem that is orthogonal to the uVisor IRQ APIs.
Behavior for other secure boxes will stay unchanged. You need to call `NVIC_SetVector` before any other NVIC API to get exclusive access to an IRQ. Drivers that need to work inside a secure box will need to be modified to comply with this protocol.
@meriac
Contributor guide
Assessment
This issue has not been assessed yet.