HomeFreeBSD

amd64: Add MD bits for KMSAN

Description

amd64: Add MD bits for KMSAN

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. Then, to ensure that this state is
kept consistent in the face of asynchronous kernel-mode excpeptions, the
runtime uses a stack of TLS blocks, and kmsan_intr_enter() and
kmsan_intr_leave() push and pop that stack, respectively.

Use these functions in amd64 interrupt and exception handlers. Note
that handlers for user->kernel transitions need not be annotated.

Also ensure that trap frames pushed by the CPU and by handlers are
marked as initialized before they are used.

Reviewed by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31467

Details

Provenance
markjAuthored on Aug 10 2021, 9:14 PM
Reviewer
kib
Differential Revision
D31467: amd64: Add MD bits for KMSAN
Parents
rG8978608832c2: amd64: Populate the KMSAN shadow maps and integrate with the VM
Branches
Unknown
Tags
Unknown