Skip to content
  • Mark Johnston's avatar
    amd64: Add MD bits for KMSAN · b0f71f1b
    Mark Johnston authored
    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
    b0f71f1b