Skip to content
  • Peter Maydell's avatar
    a9353fe8
    exec.c: Fix breakpoint invalidation race · a9353fe8
    Peter Maydell authored
    
    
    A bug (1647683) was reported showing a crash when removing
    breakpoints.  The reproducer was bisected to 3359baad when tb_flush
    was finally made thread safe.  While in MTTCG the locking in
    breakpoint_invalidate would have prevented any problems, but
    currently tb_lock() is a NOP for system emulation.
    
    The race is between a tb_flush from the gdbstub and the
    tb_invalidate_phys_addr() in breakpoint_invalidate().
    
    Ideally we'd have actual locking here; for the moment the
    simple fix is to do a full tb_flush() for a bp invalidate,
    since that is thread-safe even if no lock is taken.
    
    Reported-by: default avatarJulian Brown <julian@codesourcery.com>
    Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Message-id: 1481047629-7763-1-git-send-email-peter.maydell@linaro.org
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    a9353fe8
    exec.c: Fix breakpoint invalidation race
    Peter Maydell authored
    
    
    A bug (1647683) was reported showing a crash when removing
    breakpoints.  The reproducer was bisected to 3359baad when tb_flush
    was finally made thread safe.  While in MTTCG the locking in
    breakpoint_invalidate would have prevented any problems, but
    currently tb_lock() is a NOP for system emulation.
    
    The race is between a tb_flush from the gdbstub and the
    tb_invalidate_phys_addr() in breakpoint_invalidate().
    
    Ideally we'd have actual locking here; for the moment the
    simple fix is to do a full tb_flush() for a bp invalidate,
    since that is thread-safe even if no lock is taken.
    
    Reported-by: default avatarJulian Brown <julian@codesourcery.com>
    Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    Message-id: 1481047629-7763-1-git-send-email-peter.maydell@linaro.org
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
Loading