• Mark Rutland's avatar
    arm64: only advance singlestep for user instruction traps · 9478f192
    Mark Rutland authored
    Our arm64_skip_faulting_instruction() helper advances the userspace
    singlestep state machine, but this is also called by the kernel BRK
    handler, as used for WARN*().
    
    Thus, if we happen to hit a WARN*() while the user singlestep state
    machine is in the active-no-pending state, we'll advance to the
    active-pending state without having executed a user instruction, and
    will take a step exception earlier than expected when we return to
    userspace.
    
    Let's fix this by only advancing the state machine when skipping a user
    instruction.
    Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
    Cc: Andrey Konovalov <andreyknvl@google.com>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Will Deacon <will.deacon@arm.com>
    Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
    9478f192
traps.c 20.1 KB