• Jonathan Kim's avatar
    drm/amdkfd: add debug suspend and resume process queues operation · a70a93fa
    Jonathan Kim authored
    In order to inspect waves from the saved context at any point during a
    debug session, the debugger must be able to preempt queues to trigger
    context save by suspending them.
    
    On queue suspend, the KFD will copy the context save header information
    so that the debugger can correctly crawl the appropriate size of the saved
    context. The debugger must then also be allowed to resume suspended queues.
    
    A queue that is newly created cannot be suspended because queue ids are
    recycled after destruction so the debugger needs to know that this has
    occurred.  Query functions will be later added that will clear a given
    queue of its new queue status.
    
    A queue cannot be destroyed while it is suspended to preserve its saved
    context during debugger inspection.  Have queue destruction block while
    a queue is suspended and unblocked when it is resumed.  Likewise, if a
    queue is about to be destroyed, it cannot be suspended.
    
    Return the number of queues successfully suspended or resumed along with
    a per queue status array where the upper bits per queue status show that
    the request was invalid (new/destroyed queue suspend request, missing
    queue) or an error occurred (HWS in a fatal state so it can't suspend or
    resume queues).
    Signed-off-by: default avatarJonathan Kim <jonathan.kim@amd.com>
    Reviewed-by: default avatarFelix Kuehling <felix.kuehling@amd.com>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    a70a93fa
amdgpu_amdkfd.c 21.4 KB