• Mark Rutland's avatar
    ARM: 8128/1: abort: don't clear the exclusive monitors · 8630bac3
    Mark Rutland authored
    commit 85868313 upstream.
    
    The ARMv6 and ARMv7 early abort handlers clear the exclusive monitors
    upon entry to the kernel, but this is redundant:
    
      - We clear the monitors on every exception return since commit
        200b812d ("Clear the exclusive monitor when returning from an
        exception"), so this is not necessary to ensure the monitors are
        cleared before returning from a fault handler.
    
      - Any dummy STREX will target a temporary scratch area in memory, and
        may succeed or fail without corrupting useful data. Its status value
        will not be used.
    
      - Any other STREX in the kernel must be preceded by an LDREX, which
        will initialise the monitors consistently and will not depend on the
        earlier state of the monitors.
    
    Therefore we have no reason to care about the initial state of the
    exclusive monitors when a data abort is taken, and clearing the monitors
    prior to exception return (as we already do) is sufficient.
    
    This patch removes the redundant clearing of the exclusive monitors from
    the early abort handlers.
    Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
    Acked-by: default avatarWill Deacon <will.deacon@arm.com>
    Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    8630bac3
abort-ev6.S 1.15 KB