- Interrupt and exception handlers must call kmsan_intr_enter()
prior to calling any C code. This is because the KMSAN runtime
maintains some TLS in order to track initialization state of
function parameters and return values across function calls.
To ensure that this state is kept consistent, the runtime uses a stack
of TLS blocks, and kmsan_intr_enter() and kmsan_intr_leave() push and
pop that stack, respectively.
- C code called in interrupt/exception context has to mark trap frames
as initialized, since the assembly code which saves registers is not
instrumented (and of course the hardware trapframe needs to be marked
initialized as well).
Sponsored by: The FreeBSD Foundation